diff options
author | Pan Bian <bianpan2016@163.com> | 2016-12-04 18:46:03 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-05 15:03:34 -0500 |
commit | 005f7e68e74df94c2a676b5a3e98c6fb65aae606 (patch) | |
tree | 0a3991f85dcb5dd1adac1fbf4f09c2ea1dd3e996 /Documentation | |
parent | 0ff18d2d36efad65572990fa7febeb3ebe19da89 (diff) |
net: bnx2x: fix improper return value
Macro BNX2X_ALLOC_AND_SET(arr, lbl, func) calls kmalloc() to allocate
memory, and jumps to label "lbl" if the allocation fails. Label "lbl"
first cleans memory and then returns variable rc. Before calling the
macro, the value of variable rc is 0. Because 0 means no error, the
callers of bnx2x_init_firmware() may be misled. This patch fixes the bug,
assigning "-ENOMEM" to rc before calling macro NX2X_ALLOC_AND_SET().
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189141
Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions