[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c6ed9349-1a9a-62a9-521f-a12ec8c4a5a5@redhat.com>
Date: Thu, 13 May 2021 08:27:17 -0700
From: Tom Rix <trix@...hat.com>
To: Lizhi Hou <lizhi.hou@...inx.com>, linux-kernel@...r.kernel.org
Cc: linux-fpga@...r.kernel.org, maxz@...inx.com,
sonal.santan@...inx.com, yliu@...inx.com, michal.simek@...inx.com,
stefanos@...inx.com, devicetree@...r.kernel.org, mdf@...nel.org,
robh@...nel.org, Max Zhen <max.zhen@...inx.com>
Subject: Re: [PATCH V6 XRT Alveo 08/20] fpga: xrt: driver infrastructure
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@...inx.com>
> Signed-off-by: Max Zhen <max.zhen@...inx.com>
> Signed-off-by: Lizhi Hou <lizhi.hou@...inx.com>
> Reviewed-by: Tom Rix <trix@...hat.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?
Tom
> +}
Powered by blists - more mailing lists