Skip to content

Commit

Permalink
staging: axis-fifo: add error handling of class_create()
Browse files Browse the repository at this point in the history
Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
khoroshilov authored and gregkh committed Oct 2, 2018
1 parent 869d3ac commit a24b420
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/axis-fifo/axis-fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit a24b420

Please sign in to comment.