diff options
author | Todd Poynor <toddpoynor@google.com> | 2018-07-19 20:49:04 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-21 08:50:35 +0200 |
commit | ae27b2f9f76afc7bf77ef6001ba47fad43a9fce3 (patch) | |
tree | 500040d6e73f352bad466762f72444b5e31e75a8 /drivers/staging/gasket/gasket_core.c | |
parent | b6fdbbb743ce86030d0898b53d64ff009fd50faa (diff) |
staging: gasket: fix class create bug handling
class_create() never returns NULL, and this driver should never return
PTR_ERR(NULL) anyway.
Reported-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Zhongze Hu <frankhu@chromium.org>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/gasket/gasket_core.c')
-rw-r--r-- | drivers/staging/gasket/gasket_core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c index 18cc8e3283b3..53236e1ba4e4 100644 --- a/drivers/staging/gasket/gasket_core.c +++ b/drivers/staging/gasket/gasket_core.c @@ -321,7 +321,7 @@ int gasket_register_device(const struct gasket_driver_desc *driver_desc) internal->class = class_create(driver_desc->module, driver_desc->name); - if (IS_ERR_OR_NULL(internal->class)) { + if (IS_ERR(internal->class)) { gasket_nodev_error("Cannot register %s class [ret=%ld]", driver_desc->name, PTR_ERR(internal->class)); ret = PTR_ERR(internal->class); |