Re: [PATCH] libnvdimm: remove redundant assignment to pointer 'dev'

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

 



On 05/02/18 18:44, Dan Williams wrote:
> On Mon, Feb 5, 2018 at 10:20 AM, Ross Zwisler
> <ross.zwisler@xxxxxxxxxxxxxxx> wrote:
>> On Mon, Feb 05, 2018 at 02:08:52PM +0000, Colin King wrote:
>>> From: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>>>
>>> Pointer dev is being assigned a value that is never read, it is being
>>> re-assigned the same value later on, hence the initialization is redundant
>>> and can be removed.
>>>
>>> Cleans up clang warning:
>>> drivers/nvdimm/pfn_devs.c:307:17: warning: Value stored to 'dev' during
>>> its initialization is never read
>>>
>>> Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
>>
>> Reviewed-by: Ross Zwisler <ross.zwisler@xxxxxxxxxxxxxxx>
>>
>> More importantly this fixes a potential NULL pointer dereference.  nd_pfn
>> is checked for NULL a few lines down, but we would have crashed here trying to
>> get nd_pfn->dev.
>>
> 
> No we wouldn't crash. We're just calculating the address, not
> de-referencing a NULL pointer.

Indeed, it's just a warning clean up. Nothing more.

> --
> 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
> 

--
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