diff options
author | Pan Bian <bianpan2016@163.com> | 2016-12-04 14:45:38 +0800 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-12-14 14:35:23 -0500 |
commit | 46d0703fac3ffa12ec36f22f386d96d0f474c9c2 (patch) | |
tree | c15928a73813d5eaf2e54f685d1e0814ae4d8311 /certs/system_certificates.S | |
parent | 5b4c9cd7e4790f37b595aeb4bf6fcbf7e3ba9e2c (diff) | |
download | linux-46d0703fac3ffa12ec36f22f386d96d0f474c9c2.tar.bz2 |
IB/mlx4: fix improper return value
If uhw->inlen is non-zero, the value of variable err is 0 if the copy
succeeds. Then, if kzalloc() or kmalloc() returns a NULL pointer, it
will return 0 to the callers. As a result, the callers cannot detect the
errors. This patch fixes the bug, assign "-ENOMEM" to err before the
NULL pointer checks, and remove the initialization of err at the
beginning.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189031
Signed-off-by: Pan Bian <bianpan2016@163.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'certs/system_certificates.S')
0 files changed, 0 insertions, 0 deletions