lkml.org 
[lkml]   [2013]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] AHCI: fix Null pointer dereference in achi_host_active()
From
On Tue, Jul 23, 2013 at 5:28 AM, Tejun Heo <tj@kernel.org> wrote:
> Hello, Xiaotian.
>
> Thanks for the fix. A couple comments below.
>
> On Wed, Jul 17, 2013 at 02:10:39PM +0800, Xiaotian Feng wrote:
>> for (i = 0; i < host->n_ports; i++) {
>> struct ahci_port_priv *pp = host->ports[i]->private_data;
>> + const char *desc;
>>
>> + if (ata_port_is_dummy(host->ports[i]))
>> + desc = dev_driver_string(host->dev);
>> + else
>> + desc = pp->irq_desc;
>
> I think it'd be better to branch on pp. ie. do "if (pp) desc =
> pp->... " instead and then add a comment saying "pp is NULL for
> dummies".
>

Okay, I'll update v2 patch, thanks :)

> Thanks!
>
> --
> tejun


\
 
 \ /
  Last update: 2013-07-23 00:21    [W:0.063 / U:1.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site