lkml.org 
[lkml]   [2021]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V6 XRT Alveo 08/20] fpga: xrt: driver infrastructure
From
Date


On 05/13/2021 08:27 AM, Tom Rix wrote:
>
> On 5/11/21 6:53 PM, Lizhi Hou wrote:
>> Infrastructure code providing APIs for managing leaf driver instance
>> groups, facilitating inter-leaf driver calls and root calls.
>>
>> Signed-off-by: Sonal Santan <sonal.santan@xilinx.com>
>> Signed-off-by: Max Zhen <max.zhen@xilinx.com>
>> Signed-off-by: Lizhi Hou <lizhi.hou@xilinx.com>
>> Reviewed-by: Tom Rix <trix@redhat.com>
>
>> +
>> +int xrt_subdev_root_request(struct xrt_device *self, u32 cmd, void
>> *arg)
>> +{
>> + struct device *dev = DEV(self);
>> + struct xrt_subdev_platdata *pdata = DEV_PDATA(self);
>> +
>> + WARN_ON(!pdata->xsp_root_cb);
>> + return (*pdata->xsp_root_cb)(dev->parent,
>> pdata->xsp_root_cb_arg, cmd, arg);
>
> I am running v6 through clang's static analyzer.
>
> It reports this problem
>
> drivers/fpga/xrt/lib/subdev.c:72:9: warning: Called function pointer is
> null (null dereference)
> return (*pdata->xsp_root_cb)(dev->parent,
> pdata->xsp_root_cb_arg, cmd, arg);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Though there is a warn_on, can you also add a
>
> return -EINVAL;
>
> To cover this case?
Sure. I will run through clang myself to check the fix.

Thanks,
Lizhi
>
> Tom
>
>> +}
>

\
 
 \ /
  Last update: 2021-05-20 04:49    [W:0.076 / U:0.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site