Commit bf476fe
ata: libata-core: fix NULL pointer deref in ata_host_alloc_pinfo()
In an unlikely (and probably wrong?) case that the 'ppi' parameter of
ata_host_alloc_pinfo() points to an array starting with a NULL pointer,
there's going to be a kernel oops as the 'pi' local variable won't get
reassigned from the initial value of NULL. Initialize 'pi' instead to
'&ata_dummy_port_info' to fix the possible kernel oops for good...
Found by Linux Verification Center (linuxtesting.org) with the SVACE static
analysis tool.
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>1 parent a734510 commit bf476fe
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5462 | 5462 | | |
5463 | 5463 | | |
5464 | 5464 | | |
5465 | | - | |
| 5465 | + | |
5466 | 5466 | | |
5467 | 5467 | | |
5468 | 5468 | | |
5469 | 5469 | | |
5470 | 5470 | | |
5471 | 5471 | | |
5472 | 5472 | | |
5473 | | - | |
| 5473 | + | |
5474 | 5474 | | |
5475 | 5475 | | |
5476 | 5476 | | |
| |||
0 commit comments