summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2018-05-14 13:00:52 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-14 23:32:23 +0200
commit2e4d2e563f23930b06c24b7bc543bf04321d81f7 (patch)
treecbad147e0a91ae2c73cc4e211456ed751f209144
parented5b98483a30c034ab7ba666af2c26161828323d (diff)
downloaddpdk-2e4d2e563f23930b06c24b7bc543bf04321d81f7.zip
dpdk-2e4d2e563f23930b06c24b7bc543bf04321d81f7.tar.gz
dpdk-2e4d2e563f23930b06c24b7bc543bf04321d81f7.tar.xz
net/vdev_netvsc: readlink inputs cannot be aliased
drivers/net/vdev_netvsc/vdev_netvsc.c:335:2:error: passing argument 2 to restrict-qualified parameter aliases with argument 1 ret = readlink(buf, buf, size); ^~~ Fixes: e7dc5d7becc5 ("net/vdev_netvsc: implement core functionality") Cc: stable@dpdk.org Signed-off-by: Andy Green <andy@warmcat.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
-rw-r--r--drivers/net/vdev_netvsc/vdev_netvsc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index c321a9f..ac26e0a 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -327,12 +327,15 @@ static int
vdev_netvsc_sysfs_readlink(char *buf, size_t size, const char *if_name,
const char *relpath)
{
+ struct vdev_netvsc_ctx *ctx;
+ char in[RTE_MAX(sizeof(ctx->yield), 256u)];
int ret;
- ret = snprintf(buf, size, "/sys/class/net/%s/%s", if_name, relpath);
- if (ret == -1 || (size_t)ret >= size)
+ ret = snprintf(in, sizeof(in) - 1, "/sys/class/net/%s/%s",
+ if_name, relpath);
+ if (ret == -1 || (size_t)ret >= sizeof(in))
return -ENOBUFS;
- ret = readlink(buf, buf, size);
+ ret = readlink(in, buf, size);
if (ret == -1)
return -errno;
if ((size_t)ret >= size - 1)