Skip to content

Commit

Permalink
drivers/misc/c2port/c2port-duramar2150.c: checking for NULL instead o…
Browse files Browse the repository at this point in the history
…f IS_ERR()

c2port_device_register() never returns NULL, it uses error pointers.

Link: http://lkml.kernel.org/r/20170412083321.GC3250@mwanda
Fixes: 65131cd ("c2port: add c2port support for Eurotech Duramar 2150")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Rodolfo Giometti <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Dan Carpenter authored and torvalds committed May 9, 2017
1 parent 146180c commit 8128a31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/misc/c2port/c2port-duramar2150.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ static int __init duramar2150_c2port_init(void)

duramar2150_c2port_dev = c2port_device_register("uc",
&duramar2150_c2port_ops, NULL);
if (!duramar2150_c2port_dev) {
ret = -ENODEV;
if (IS_ERR(duramar2150_c2port_dev)) {
ret = PTR_ERR(duramar2150_c2port_dev);
goto free_region;
}

Expand Down

0 comments on commit 8128a31

Please sign in to comment.