From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5B961F76A4; Tue, 3 Dec 2024 15:07:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733238477; cv=none; b=dBheOeO7jUJEoL4D623A1UFC1XvzECz2i3DP+JurPW1GK3ZmxkQB0qmOgyTMXq0NN8ZCYo25G2+3NYTHrPk7I0M+mrsiHMM4EaINDiCAArCKuXZ3Jiz8xKLzrZa+R8wyEB7sg51e6pF00BSQE7a+srmNTkQczWd5t2Ixf34fOKE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733238477; c=relaxed/simple; bh=A6dt4J6RJhQb4J/YIfH3isNzsdT2EbpTLmBF6mjeJVA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=feRpoyTbApn4hglGAAsfEqIGsdJE9uMvufCtVGvKzFEYuiWtDsb2GJfrZ92ksLC7fa5NIS+wo7KpighwmZiaqm/C7Ohd27iHw8SdxM350Tcqp5Mx/pW9GlWE+o9faRnwnrD4CM3jkVdMooPkbDvpKRLnPgpWjHRWfMhB4XcvhE4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uSqKAtTu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="uSqKAtTu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66E06C4CED8; Tue, 3 Dec 2024 15:07:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1733238476; bh=A6dt4J6RJhQb4J/YIfH3isNzsdT2EbpTLmBF6mjeJVA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uSqKAtTuvol4+UDasZIzCERsBRc95sZCqcOQWYIIxnxGuIknNIzei55CrEOF0lt8W NZcwrS4BnxjWbewkzVeeOay81Wc20HKkE7Z98D5TAEDy9ed9StEaIychXxv4zQ/dlb D1VUVtuwxQ8EPjq/kuWz5Pw+lIZgDtJEzkTLhx/w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dipendra Khadka , Simon Horman , Andrew Lunn , Sasha Levin Subject: [PATCH 6.11 290/817] octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_dmac_flt.c Date: Tue, 3 Dec 2024 15:37:42 +0100 Message-ID: <20241203144007.129561745@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241203143955.605130076@linuxfoundation.org> References: <20241203143955.605130076@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.11-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dipendra Khadka [ Upstream commit f5b942e6c54b13246ee49d42dcfb71b7f29e3c64 ] Add error pointer checks after calling otx2_mbox_get_rsp(). Fixes: 79d2be385e9e ("octeontx2-pf: offload DMAC filters to CGX/RPM block") Fixes: fa5e0ccb8f3a ("octeontx2-pf: Add support for exact match table.") Signed-off-by: Dipendra Khadka Reviewed-by: Simon Horman Signed-off-by: Andrew Lunn Signed-off-by: Sasha Levin --- .../net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c index 80d853b343f98..2046dd0da00d8 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_dmac_flt.c @@ -28,6 +28,11 @@ static int otx2_dmacflt_do_add(struct otx2_nic *pf, const u8 *mac, if (!err) { rsp = (struct cgx_mac_addr_add_rsp *) otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) { + mutex_unlock(&pf->mbox.lock); + return PTR_ERR(rsp); + } + *dmac_index = rsp->index; } @@ -200,6 +205,10 @@ int otx2_dmacflt_update(struct otx2_nic *pf, u8 *mac, u32 bit_pos) rsp = (struct cgx_mac_addr_update_rsp *) otx2_mbox_get_rsp(&pf->mbox.mbox, 0, &req->hdr); + if (IS_ERR(rsp)) { + rc = PTR_ERR(rsp); + goto out; + } pf->flow_cfg->bmap_to_dmacindex[bit_pos] = rsp->index; -- 2.43.0