Re: [rdma-rc 08/14] RDMA/mlx4: Avoid potential derefence warning

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

 



On Mon, 2017-07-31 at 10:09 +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> 
> The smatch complains about possible dereference, it is unclear from
> source how it can occur, since in case of failure to find/allocate
> group, the acquire_group() will return error.
> 
> Avoid the following error, by changing IS_ERR() to be IS_ERR_OR_NULL().
> 
> drivers/infiniband/hw/mlx4/mcg.c:964 mlx4_ib_mcg_multiplex_handler() error:
> 	potential null dereference 'group'.  (acquire_group returns null)

Hello Leon,

I agree with you that it's not clear from the source code how acquire_group()
could return null. My proposal is to drop this patch and to report this as a
bug to the smatch author (Dan Carpenter). I don't think it makes sense to
modify kernel code that is fine because a tool (smatch) reports a false positive.

Thanks,

Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux