On 07/23/2018 09:26 AM, Oleksandr Andrushchenko wrote:Thank you, this is for "[PATCH v5 7/8] xen/gntdev: Implement dma-buf export functionality"
On 07/23/2018 11:38 AM, Oleksandr Andrushchenko wrote:
Now I see this warning which seems to be a false positive.data/upstream/linux-xen/drivers/xen/gntdev-dmabuf.c: In functionStrangely, but my i386 build goes smooth.
âgntdev_ioctl_dmabuf_exp_from_refsâ:
/data/upstream/linux-xen/drivers/xen/gntdev-dmabuf.c:503:6: warning:
âargs.fdâ may be used uninitialized in this function
[-Wmaybe-uninitialized]
ÂÂ *fd = args.fd;
ÂÂ ~~~~^~~~~~~~~
/data/upstream/linux-xen/drivers/xen/gntdev-dmabuf.c:467:35: note:
âargs.fdâ was declared here
ÂÂ struct gntdev_dmabuf_export_args args;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ^~~~
Which version of gcc you use and could you please give me your
.config, so I can test the same?
Boris, could you please apply the following:
diff --git a/drivers/xen/gntdev-dmabuf.c b/drivers/xen/gntdev-dmabuf.c
index e4c9f1f74476..0680dbcba616 100644
--- a/drivers/xen/gntdev-dmabuf.c
+++ b/drivers/xen/gntdev-dmabuf.c
@@ -495,6 +495,7 @@ static int dmabuf_exp_from_refs(struct gntdev_priv
*priv, int flags,
ÂÂÂÂÂÂÂ args.dmabuf_priv = priv->dmabuf_priv;
ÂÂÂÂÂÂÂ args.count = map->count;
ÂÂÂÂÂÂÂ args.pages = map->pages;
+ÂÂÂÂÂÂ args.fd = -1;
ÂÂÂÂÂÂÂ ret = dmabuf_exp_from_pages(&args);
ÂÂÂÂÂÂÂ if (ret < 0)
or please let me know if you want me to resend with this fix?
Missed this message. Yes, this obviously fixes the problem. And it is
due to the code fragment that I mentioned in the earlier response.
Which patch is this for? I can add this when committing.
-borisThank you,