All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] gpio: fix deferred probe detection for legacy API
@ 2017-07-14 11:34 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-07-14 11:34 UTC (permalink / raw)
  To: acourbot; +Cc: linux-gpio

[ This one is quite old, and hasn't caused a problem so probably the
  NULL check is not required?  -dan ]

Hello Alexandre Courbot,

This is a semi-automatic email about new static checker warnings.

The patch 0e9a5edf5d01: "gpio: fix deferred probe detection for
legacy API" from Dec 2, 2014, leads to the following Smatch complaint:

    drivers/gpio/gpiolib-legacy.c:36 gpio_request_one()
    error: we previously assumed 'desc' could be null (see line 28)

drivers/gpio/gpiolib-legacy.c
    27		/* Compatibility: assume unavailable "valid" GPIOs will appear later */
    28		if (!desc && gpio_is_valid(gpio))
                    ^^^^^
Patch adds a new check.

    29			return -EPROBE_DEFER;
    30	
    31		err = gpiod_request(desc, label);
    32		if (err)
    33			return err;
    34	
    35		if (flags & GPIOF_OPEN_DRAIN)
    36			set_bit(FLAG_OPEN_DRAIN, &desc->flags);
                                                  ^^^^^^^^^^^
But these dereferences aren't checked.

    37	
    38		if (flags & GPIOF_OPEN_SOURCE)

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-14 11:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-14 11:34 [bug report] gpio: fix deferred probe detection for legacy API Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.