summaryrefslogtreecommitdiff
path: root/drivers/staging/axis-fifo
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2018-09-29 00:25:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-02 15:18:36 -0700
commita24b420bb30e4baea66f4467fdcdabb456e30993 (patch)
treef33ed85c3da0d1012aeff78bd370c5843e314817 /drivers/staging/axis-fifo
parent869d3acd488c282421468b60b5c6ed205c1da1b0 (diff)
staging: axis-fifo: add error handling of class_create()
Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/axis-fifo')
-rw-r--r--drivers/staging/axis-fifo/axis-fifo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/axis-fifo/axis-fifo.c b/drivers/staging/axis-fifo/axis-fifo.c
index abeee0ecc122..63c8efd1b8db 100644
--- a/drivers/staging/axis-fifo/axis-fifo.c
+++ b/drivers/staging/axis-fifo/axis-fifo.c
@@ -1089,6 +1089,8 @@ static int __init axis_fifo_init(void)
pr_info("axis-fifo driver loaded with parameters read_timeout = %i, write_timeout = %i\n",
read_timeout, write_timeout);
axis_fifo_driver_class = class_create(THIS_MODULE, DRIVER_NAME);
+ if (IS_ERR(axis_fifo_driver_class))
+ return PTR_ERR(axis_fifo_driver_class);
return platform_driver_register(&axis_fifo_driver);
}