All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] lib: Add generic PIO mapping method
@ 2018-04-04 12:41 Dan Carpenter
  2018-04-04 13:44 ` Bjorn Helgaas
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-04-04 12:41 UTC (permalink / raw)
  To: kernel-janitors

Hello Zhichang Yuan,

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

The patch 07a1cb330513: "lib: Add generic PIO mapping method" from
Mar 15, 2018, leads to the following Smatch complaint:

    lib/logic_pio.c:42 logic_pio_register_range()
    warn: variable dereferenced before check 'new_range' (see line 36)

lib/logic_pio.c
    35		struct logic_pio_hwaddr *range;
    36		resource_size_t start = new_range->hw_start;
                                        ^^^^^^^^^^^^^^^^^^^^
    37		resource_size_t end = new_range->hw_start + new_range->size;
                                      ^^^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^
Dereference.

    38		resource_size_t mmio_sz = 0;
    39		resource_size_t iio_sz = MMIO_UPPER_LIMIT;
    40		int ret = 0;
    41	
    42		if (!new_range || !new_range->fwnode || !new_range->size)
                     ^^^^^^^^^
Check for NULL.

    43			return -EINVAL;
    44	

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-04 13:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-04 12:41 [bug report] lib: Add generic PIO mapping method Dan Carpenter
2018-04-04 13:44 ` Bjorn Helgaas

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.