Skip to content

Commit

Permalink
[media] am437x-vpfe: always assign bpp variable
Browse files Browse the repository at this point in the history
In vpfe_s_fmt(), when the sensor format and the requested format were
the same, bpp was assigned to vpfe->bpp without being initialized first.

Grab the bpp value that is currently used by using __vpfe_get_format()
instead of its wrapper, vpfe_try_fmt().

This use of uninitialized variable has been found by compiling the
kernel with clang.

Fixes: 417d2e5 ("[media] media: platform: add VPFE capture driver
support for AM437X")

Cc: [email protected]
Signed-off-by: Nicolas Iooss <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
fishilico authored and mchehab committed Jan 30, 2017
1 parent 05a8973 commit 6ebf757
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/platform/am437x/am437x-vpfe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,7 @@ static int vpfe_s_fmt(struct file *file, void *priv,
return -EBUSY;
}

ret = vpfe_try_fmt(file, priv, &format);
ret = __vpfe_get_format(vpfe, &format, &bpp);
if (ret)
return ret;

Expand Down

0 comments on commit 6ebf757

Please sign in to comment.