diff options
author | Pan Bian <[email protected]> | 2016-12-04 14:45:38 +0800 |
---|---|---|
committer | Doug Ledford <[email protected]> | 2016-12-14 14:35:23 -0500 |
commit | 46d0703fac3ffa12ec36f22f386d96d0f474c9c2 (patch) | |
tree | c15928a73813d5eaf2e54f685d1e0814ae4d8311 /tools/perf/scripts/python/event_analyzing_sample.py | |
parent | 5b4c9cd7e4790f37b595aeb4bf6fcbf7e3ba9e2c (diff) |
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 <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions