lkml.org 
[lkml]   [2018]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH resend] staging: gasket: fix class create bug handling
Date
From: Todd Poynor <toddpoynor@google.com>

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>
---
drivers/staging/gasket/gasket_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index b69b630f1b79..20da6bdb7a73 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -332,7 +332,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));
return PTR_ERR(internal->class);
--
2.18.0.203.gfac676dfb9-goog
Resending, extracted from the previous stack of patches that needs
other cleanups.
\
 
 \ /
  Last update: 2018-07-15 22:07    [W:0.022 / U:2.904 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site