2016-12-03 13:58:52

by Pan Bian

[permalink] [raw]
Subject: [PATCH 1/1] infiniband: hw: ocrdma: fix bad initialization

From: Pan Bian <[email protected]>

In function ocrdma_mbx_create_ah_tbl(), returns the value of status on
errors. However, because status is initialized with 0, 0 will be
returned even if on error paths. This patch initialize status with
"-ENOMEM".

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188831

Signed-off-by: Pan Bian <[email protected]>
---
drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
index 67fc0b6..6876a71 100644
--- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
+++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c
@@ -1642,7 +1642,7 @@ static int ocrdma_build_q_conf(u32 *num_entries, int entry_size,
static int ocrdma_mbx_create_ah_tbl(struct ocrdma_dev *dev)
{
int i;
- int status = 0;
+ int status = -ENOMEM;
int max_ah;
struct ocrdma_create_ah_tbl *cmd;
struct ocrdma_create_ah_tbl_rsp *rsp;
--
1.9.1



2016-12-04 06:20:46

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH 1/1] infiniband: hw: ocrdma: fix bad initialization

On Sat, Dec 03, 2016 at 09:10:21PM +0800, Pan Bian wrote:
> From: Pan Bian <[email protected]>
>
> In function ocrdma_mbx_create_ah_tbl(), returns the value of status on
> errors. However, because status is initialized with 0, 0 will be
> returned even if on error paths. This patch initialize status with
> "-ENOMEM".
>
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188831
>
> Signed-off-by: Pan Bian <[email protected]>

Thanks,
Reviewed-by: Leon Romanovsky <[email protected]>


Attachments:
(No filename) (496.00 B)
signature.asc (819.00 B)
Download all attachments

2016-12-14 19:35:22

by Doug Ledford

[permalink] [raw]
Subject: Re: [PATCH 1/1] infiniband: hw: ocrdma: fix bad initialization

On 12/4/2016 1:20 AM, Leon Romanovsky wrote:
> On Sat, Dec 03, 2016 at 09:10:21PM +0800, Pan Bian wrote:
>> From: Pan Bian <[email protected]>
>>
>> In function ocrdma_mbx_create_ah_tbl(), returns the value of status on
>> errors. However, because status is initialized with 0, 0 will be
>> returned even if on error paths. This patch initialize status with
>> "-ENOMEM".
>>
>> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188831
>>
>> Signed-off-by: Pan Bian <[email protected]>
>
> Thanks,
> Reviewed-by: Leon Romanovsky <[email protected]>
>

Thanks, applied.

--
Doug Ledford <[email protected]>
GPG Key ID: 0E572FDD


Attachments:
signature.asc (884.00 B)
OpenPGP digital signature