Commit ae27b2f9 authored by Todd Poynor's avatar Todd Poynor Committed by Greg Kroah-Hartman

staging: gasket: fix class create bug handling

class_create() never returns NULL, and this driver should never return
PTR_ERR(NULL) anyway.
Reported-by: default avatarDmitry Torokhov <dtor@chromium.org>
Signed-off-by: default avatarZhongze Hu <frankhu@chromium.org>
Signed-off-by: default avatarTodd Poynor <toddpoynor@google.com>
Reviewed-by: default avatarDmitry Torokhov <dtor@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b6fdbbb7
...@@ -321,7 +321,7 @@ int gasket_register_device(const struct gasket_driver_desc *driver_desc) ...@@ -321,7 +321,7 @@ int gasket_register_device(const struct gasket_driver_desc *driver_desc)
internal->class = internal->class =
class_create(driver_desc->module, driver_desc->name); 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]", gasket_nodev_error("Cannot register %s class [ret=%ld]",
driver_desc->name, PTR_ERR(internal->class)); driver_desc->name, PTR_ERR(internal->class));
ret = PTR_ERR(internal->class); ret = PTR_ERR(internal->class);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment