From: Florinel Iordache Date: Mon, 26 Apr 2021 12:16:12 +0000 (+0300) Subject: fsl_qbman: usdpaa: initialize ioctl structures X-Git-Tag: rel_imx_5.10.35_2.0.0-somdevices.0~171 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=07772004f7ac3f3d2ec515caa111c7ddeba78b2f;p=linux.git fsl_qbman: usdpaa: initialize ioctl structures Fix 4 x Coverity issues: Untrusted loop bound (TAINTED_SCALAR): tainted_argument: Calling function copy_from_user taints argument input Signed-off-by: Florinel Iordache --- diff --git a/drivers/staging/fsl_qbman/fsl_usdpaa.c b/drivers/staging/fsl_qbman/fsl_usdpaa.c index b4e37f316bef..5eb53a731a1c 100644 --- a/drivers/staging/fsl_qbman/fsl_usdpaa.c +++ b/drivers/staging/fsl_qbman/fsl_usdpaa.c @@ -883,7 +883,7 @@ static unsigned long usdpaa_get_unmapped_area(struct file *file, static long ioctl_id_alloc(struct ctx *ctx, void __user *arg) { - struct usdpaa_ioctl_id_alloc i; + struct usdpaa_ioctl_id_alloc i = {0}; const struct alloc_backend *backend; struct active_resource *res; int ret = copy_from_user(&i, arg, sizeof(i)); @@ -959,7 +959,7 @@ found: static long ioctl_id_reserve(struct ctx *ctx, void __user *arg) { - struct usdpaa_ioctl_id_reserve i; + struct usdpaa_ioctl_id_reserve i = {0}; const struct alloc_backend *backend; struct active_resource *tmp, *pos; @@ -2047,7 +2047,7 @@ static long usdpaa_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) return ioctl_id_reserve(ctx, a); case USDPAA_IOCTL_DMA_MAP: { - struct usdpaa_ioctl_dma_map input; + struct usdpaa_ioctl_dma_map input = {0}; int ret; if (copy_from_user(&input, a, sizeof(input))) return -EFAULT; @@ -2171,7 +2171,7 @@ static long usdpaa_ioctl_compat(struct file *fp, unsigned int cmd, case USDPAA_IOCTL_DMA_MAP_COMPAT: { int ret; - struct usdpaa_ioctl_dma_map_compat input; + struct usdpaa_ioctl_dma_map_compat input = {0}; struct usdpaa_ioctl_dma_map converted = {0}; if (copy_from_user(&input, a, sizeof(input)))