From owner-dev-commits-src-branches@freebsd.org Sun May 16 03:25:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85199632AC5; Sun, 16 May 2021 03:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FjSLm39vYz3Plh; Sun, 16 May 2021 03:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 547A111D0E; Sun, 16 May 2021 03:25:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14G3P4Xi006839; Sun, 16 May 2021 03:25:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14G3P4ek006838; Sun, 16 May 2021 03:25:04 GMT (envelope-from git) Date: Sun, 16 May 2021 03:25:04 GMT Message-Id: <202105160325.14G3P4ek006838@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: 81ec0d054652 - stable/13 - cxgbe/tom: Fix potential leak in t4_aiotx_process_job. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 81ec0d0546522af8e1870d11e162e5b479e90640 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2021 03:25:04 -0000 The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=81ec0d0546522af8e1870d11e162e5b479e90640 commit 81ec0d0546522af8e1870d11e162e5b479e90640 Author: Navdeep Parhar AuthorDate: 2021-04-04 22:04:31 +0000 Commit: Navdeep Parhar CommitDate: 2021-05-16 03:24:06 +0000 cxgbe/tom: Fix potential leak in t4_aiotx_process_job. The mbuf allocated could be a chain and must be freed with m_freem. Reviewed by: jhb@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D29579 (cherry picked from commit bf5057691bb0d1160d729772cdb4c449e366f5b4) --- sys/dev/cxgbe/tom/t4_cpl_io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 1e50bf860787..ee40d0646b71 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2204,8 +2204,7 @@ out: job->aio_error = (void *)(intptr_t)error; aiotx_free_job(job); } - if (m != NULL) - m_free(m); + m_freem(m); SOCKBUF_LOCK(sb); }