Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b4c9cd7 authored by Pan Bian's avatar Pan Bian Committed by Doug Ledford
Browse files

IB/ocrdma: fix bad initialization

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: default avatarPan Bian <bianpan2016@163.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 6a3a1056
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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)
static int ocrdma_mbx_create_ah_tbl(struct ocrdma_dev *dev)
{
{
	int i;
	int i;
	int status = 0;
	int status = -ENOMEM;
	int max_ah;
	int max_ah;
	struct ocrdma_create_ah_tbl *cmd;
	struct ocrdma_create_ah_tbl *cmd;
	struct ocrdma_create_ah_tbl_rsp *rsp;
	struct ocrdma_create_ah_tbl_rsp *rsp;