Re: [bug report] RDMA/hns: Add support for XRC on HIP09

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

 



On 2021/3/18 21:15, Dan Carpenter wrote:
> Hello Wenpeng Liang,
> 
> The patch 32548870d438: "RDMA/hns: Add support for XRC on HIP09" from
> Mar 4, 2021, leads to the following static checker warning:
> 
> 	drivers/infiniband/hw/hns/hns_roce_pd.c:143 hns_roce_xrcd_alloc()
> 	warn: passing casted pointer 'xrcdn' to 'hns_roce_bitmap_alloc()' 32 vs 64.
> 
> drivers/infiniband/hw/hns/hns_roce_pd.c
>    141  static int hns_roce_xrcd_alloc(struct hns_roce_dev *hr_dev, u32 *xrcdn)
>    142  {
>    143          return hns_roce_bitmap_alloc(&hr_dev->xrcd_bitmap,
>    144                                       (unsigned long *)xrcdn);
> 
> The hns_roce_bitmap_alloc() is going to write a ulong to &xrcd->xrcdn
> so this will lead to memory corruption.
> 
>    145  }
>    146  
> 
> regards,
> dan carpenter
> 

Hi Dan,

Thanks for your reminder, we fill fix it ASAP.

Weihang



[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