Re: [PATCH 14/18] staging: gasket: fix class create bug handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 14, 2018 at 8:59 AM Todd Poynor <toddpoynor@xxxxxxxxx> wrote:
>
> From: Todd Poynor <toddpoynor@xxxxxxxxxx>
>
> class_create() never returns NULL, and this driver should never return
> PTR_ERR(NULL) anyway.
>
> Reported-by: Dmitry Torokhov <dtor@xxxxxxxxxxxx>
> Signed-off-by: Zhongze Hu <frankhu@xxxxxxxxxxxx>
> Signed-off-by: Todd Poynor <toddpoynor@xxxxxxxxxx>

Reviewed-by: Dmitry Torokhov <dtor@xxxxxxxxxxxx>

> ---
>  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 f7d8f66e8746..0ef37667e0f1 100644
> --- a/drivers/staging/gasket/gasket_core.c
> +++ b/drivers/staging/gasket/gasket_core.c
> @@ -341,7 +341,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);
> --
> 2.18.0.203.gfac676dfb9-goog
>
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux