aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorTom Rix <[email protected]>2021-01-11 14:09:04 -0800
committerJohan Hovold <[email protected]>2021-01-12 09:59:17 +0100
commit161a582bd1d8681095f158d11bc679a58f1d026b (patch)
tree49f9a7cfa941258da3a8c80455c6b157ea10792d /tools/perf/scripts/python
parent7c53f6b671f4aba70ff15e1b05148b10d58c2837 (diff)
USB: serial: mos7720: improve OOM-handling in read_mos_reg()
clang static analysis reports this problem mos7720.c:352:2: warning: Undefined or garbage value returned to caller return d; ^~~~~~~~ In the parport_mos7715_read_data()'s call to read_mos_reg(), 'd' is only set after the alloc block. buf = kmalloc(1, GFP_KERNEL); if (!buf) return -ENOMEM; Although the problem is reported in parport_most7715_read_data(), none of the callee's of read_mos_reg() check the return status. Make sure to clear the return-value buffer also on allocation failures. Fixes: 0d130367abf5 ("USB: serial: mos7720: fix control-message error handling") Signed-off-by: Tom Rix <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ johan: only clear the buffer on errors, amend commit message ] Signed-off-by: Johan Hovold <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions