linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [bug report] mtd: rawnand: allocate dynamically ONFI parameters during detection
@ 2018-07-31 18:26 Dan Carpenter
  2018-08-01  6:56 ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2018-07-31 18:26 UTC (permalink / raw)
  To: miquel.raynal; +Cc: linux-mtd

Hello Miquel Raynal,

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

The patch 0ff393463e9c: "mtd: rawnand: allocate dynamically ONFI 
parameters during detection" from Jul 25, 2018, leads to the 
following Smatch complaint:

    drivers/mtd/nand/raw/nand_micron.c:93 micron_nand_onfi_init()
     warn: variable dereferenced before check 'p->onfi' (see line 91)

drivers/mtd/nand/raw/nand_micron.c
    90		struct nand_parameters *p = &chip->parameters;
    91		struct nand_onfi_vendor_micron *micron = (void *)p->onfi->vendor;
                                                                 ^^^^^^^^^^^^^^^
The code dereferences "p->onfi"

    92	
    93		if (p->onfi) {
                    ^^^^^^^
but the patch adds a new check for NULL.

    94			chip->read_retries = micron->read_retry_options;
    95			chip->setup_read_retry = micron_nand_setup_read_retry;

regards,
dan carpenter

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

end of thread, other threads:[~2018-08-01  6:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-31 18:26 [bug report] mtd: rawnand: allocate dynamically ONFI parameters during detection Dan Carpenter
2018-08-01  6:56 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).