Re: [PATCH 1/1] infiniband: hw: mlx4: fix improper return value

2016-12-14 Thread Doug Ledford
On 12/4/2016 1:45 AM, Pan Bian wrote: > From: Pan Bian > > 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

Re: [PATCH 1/1] infiniband: hw: mlx4: fix improper return value

2016-12-14 Thread Doug Ledford
On 12/4/2016 1:45 AM, Pan Bian wrote: > From: Pan Bian > > 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

Re: [PATCH 1/1] infiniband: hw: mlx4: fix improper return value

2016-12-03 Thread Leon Romanovsky
On Sun, Dec 04, 2016 at 02:45:38PM +0800, Pan Bian wrote: > From: Pan Bian > > 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

Re: [PATCH 1/1] infiniband: hw: mlx4: fix improper return value

2016-12-03 Thread Leon Romanovsky
On Sun, Dec 04, 2016 at 02:45:38PM +0800, Pan Bian wrote: > From: Pan Bian > > 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 >

[PATCH 1/1] infiniband: hw: mlx4: fix improper return value

2016-12-03 Thread Pan Bian
From: Pan Bian 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

[PATCH 1/1] infiniband: hw: mlx4: fix improper return value

2016-12-03 Thread Pan Bian
From: Pan Bian 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

Re: [PATCH 1/1] infiniband: hw: mlx4: fix improper return value

2016-12-03 Thread Leon Romanovsky
On Sun, Dec 04, 2016 at 01:49:04PM +0800, Pan Bian wrote: > From: Pan Bian > > 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

Re: [PATCH 1/1] infiniband: hw: mlx4: fix improper return value

2016-12-03 Thread Leon Romanovsky
On Sun, Dec 04, 2016 at 01:49:04PM +0800, Pan Bian wrote: > From: Pan Bian > > 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 >

[PATCH 1/1] infiniband: hw: mlx4: fix improper return value

2016-12-03 Thread Pan Bian
From: Pan Bian 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, assigning

[PATCH 1/1] infiniband: hw: mlx4: fix improper return value

2016-12-03 Thread Pan Bian
From: Pan Bian 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, assigning "-ENOMEM" to err before