[bug report] lib: Add generic PIO mapping method

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

 



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
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux