linux/drivers/infiniband/hw/mlx4
Pan Bian 46d0703fac 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>
2016-12-14 14:35:23 -05:00
..
ah.c IB/mlx4: Properly initialize GRH TClass and FlowLabel in AHs 2016-06-17 19:36:54 -04:00
alias_GUID.c IB/mlx4/alias_GUID: Remove deprecated create_singlethread_workqueue 2016-10-07 16:54:33 -04:00
cm.c IB/mlx4: In mlx4_ib_demux_cm, print out GUID in host-endian order 2015-02-17 22:11:40 -08:00
cq.c Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
doorbell.c IB: Refactor umem to use linear SG table 2014-03-04 10:34:28 -08:00
Kconfig net: mellanox: add DEVLINK dependencies 2016-03-03 17:08:59 -05:00
mad.c Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
main.c IB/mlx4: fix improper return value 2016-12-14 14:35:23 -05:00
Makefile IB/mlx4: Add iov directory in sysfs under the ib device 2012-09-30 20:33:39 -07:00
mcg.c Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
mlx4_ib.h Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
mr.c IB/mlx4: Prevent cross page boundary allocation 2016-06-23 10:08:25 -04:00
qp.c Merge of primary rdma-core code for 4.9 2016-10-09 17:04:33 -07:00
srq.c IB/mlx4: Move user vendor structures 2016-10-07 16:54:36 -04:00
sysfs.c IB/mlx4: Forbid using sysfs to change RoCE pkeys 2015-08-30 18:12:22 -04:00