[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4d9b6fb7-b2c7-0f87-8b4a-da8c01f8e78d@embeddedor.com>
Date: Sat, 20 Oct 2018 08:34:52 +0200
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: "Martin K. Petersen" <martin.petersen@...cle.com>
Cc: John Garry <john.garry@...wei.com>,
"James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
Xiang Chen <chenxiang66@...ilicon.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] scsi: hisi_sas: Fix NULL pointer dereference
On 10/20/18 12:28 AM, Martin K. Petersen wrote:
>
> Gustavo,
>
>> There is a NULL pointer dereference in case *slot* happens to
>> be NULL at lines 1053 and 1878:
>>
>> struct hisi_sas_cq *cq =
>> &hisi_hba->cq[slot->dlvry_queue];
>>
>> Notice that *slot* is being NULL checked at lines 1057 and 1881:
>> if (slot), which implies it may be NULL.
>>
>> Fix this by placing the declaration and definition of variable cq,
>> which contains the pointer dereference slot->dlvry_queue, after
>> slot has been properly NULL checked.
>
> Applied to 4.20/scsi-queue, thanks!
>
Glad to help. :)
Thanks
--
Gustavo
Powered by blists - more mailing lists