Skip to content
Commit 87e92011 authored by Eugeniu Rosca's avatar Eugeniu Rosca Committed by Mauro Carvalho Chehab
Browse files

media: mxl111sf: Fix potential null pointer dereference



Reviewing the delta between cppcheck output of v4.9.39 and v4.9.40
stable updates, I stumbled on the new warning:

mxl111sf.c:80: (warning) Possible null pointer dereference: rbuf

Since copying state->rcvbuf into rbuf is not needed in the 'write-only'
scenario (i.e. calling mxl111sf_ctrl_msg() from mxl111sf_i2c_send_data()
or from mxl111sf_write_reg()), bypass memcpy() in this case.

Fixes: d90b336f ("[media] mxl111sf: Fix driver to use heap allocate buffers for USB messages")

Signed-off-by: default avatarEugeniu Rosca <erosca@de.adit-jv.com>
Reviewed-by: default avatarMichael Ira Krufky <mkrufky@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 9793e1d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment