.org (Postfix) with ESMTPS id 4hJJfL5fqVz3y9w for ; Mon, 10 Aug 2026 02:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786329082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CsBShgCN8IIwxGWl/aGtCPpzkjmKX1IkVPklKkFrG9s=; b=MzqCZeo9u8vdWlzY1fowkfSjSbkI8+fpCe4+QPqnrbyBeU3lOGOjUQJh01FMoR01YossNT eHCWL3gBG6r7y/Mw4dNyEoIk7xpU+h3jv2PMtZ+DPFZGoQscaZtYRLT9sGoRhgmrY9SlAJ sJmsTxH+73R5ZfjdCyS0wtGKPdOwwgmR3oiUaXJ4v7cmt6b0H2usBZvgf+qAC4OrUXLLUb T3HumQsITvmNp0j5p7thVVw4I4KSUqR1sI0GIWR62v1gD6v5ObPVeRY9GjD93BYBQN47KL 4jUJUIJloOYDATq+GAXlD0jfy20iJgNpe/s1N5m/75uGmYgwcw7vPegF7JETag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1786329082; a=rsa-sha256; cv=none; b=UuJRkZGKRI/uvWz3puBXhcicHd2Wb2fH+nK4nePbFr+aV++a+JRFDLgvAHxWwHroOdRNK3 tBDOHNJTt+mT3+QlT6YlElk9t0lUcEGpNFs5aSvrKNUszQSb1s4UDcZBtKxvRZ0dt+mV6y H5pNk7bl1sqB0lQj6go3/27phlZK0IgfgJYNUblUIIHNxqM5d28nnDSbIp5veWpSVvtwZV XZKPISkcLtXLkCNP9GdfCV+LQejYtgDXYRLf/Un+OI5nsp33Ik3bqdX0XYP1i3WUYPyCmQ ltZ1gMDftvitYVdA4/bXZPRd1FjvVuONxEtnu95LQwVUgpnHdVJWfJGG4i0Vbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1786329082; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CsBShgCN8IIwxGWl/aGtCPpzkjmKX1IkVPklKkFrG9s=; b=xz6VTNIKMV7C0TgF994ks5JG176KI0RRmXg3vPn9bVP0dwsl4+tlKf3yJTUciREao1c9BY AE8xVXzHn+CC4+eiJvbDA2LUiKnMk0iY99tQBgvu6IcipYwcVbtYbwdQqvBX3eKXz3mQlh z10FA6ibs8yxbkcpsEqkwlUUs+Kcwzh5GvT8GCs3eBNhUHCGcn6QaEg12WihtxSO/o0y5W bJnHrALFjPk03BpovCrzvAYTxlKfMhGsSqnkmLRjMaj5we69z10EgeCRbnIH6Q+YtcY3cx KvcMqvNaaNXbET45rC6C6//KXdXmIyGdCwvc1CuPTtntytjQJuvkXVcENMM9Mw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hJJfL4fnHzqlB for ; Mon, 10 Aug 2026 02:31:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ea29 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 10 Aug 2026 02:31:22 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jaeyoon Choi Subject: git: c2186638ff70 - main - ufshci: free the correct address when DMA load fails List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jaeyoon X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c2186638ff7052e3803f2bdab9ad62cfb69ac7de Auto-Submitted: auto-generated Date: Mon, 10 Aug 2026 02:31:22 +0000 Message-Id: <6a7937fa.1ea29.58281ac8@gitrepo.freebsd.org> The branch main has been updated by jaeyoon: URL: https://cgit.FreeBSD.org/src/commit/?id=c2186638ff7052e3803f2bdab9ad62cfb69ac7de commit c2186638ff7052e3803f2bdab9ad62cfb69ac7de Author: Jaeyoon Choi AuthorDate: 2026-08-10 01:40:28 +0000 Commit: Jaeyoon Choi CommitDate: 2026-08-10 02:28:49 +0000 ufshci: free the correct address when DMA load fails The bus_dmamap_load() error paths passed hwq->utrd and req_queue->ucd to bus_dmamem_free(), but both pointers are only assigned after a successful load and are still NULL at that point. The freshly allocated memory was leaked. Free the local buffer instead. Sponsored by: Samsung Electronics Reviewed by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D58659 --- sys/dev/ufshci/ufshci_req_sdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ufshci/ufshci_req_sdb.c b/sys/dev/ufshci/ufshci_req_sdb.c index 54542f48b32c..cc99b645331c 100644 --- a/sys/dev/ufshci/ufshci_req_sdb.c +++ b/sys/dev/ufshci/ufshci_req_sdb.c @@ -112,7 +112,7 @@ ufshci_req_sdb_cmd_desc_construct(struct ufshci_req_queue *req_queue, if (bus_dmamap_load(req_queue->dma_tag_ucd, req_queue->ucdmem_map, ucdmem, ucd_allocsz, ufshci_ucd_map, hwq, 0) != 0) { ufshci_printf(ctrlr, "failed to load cmd desc memory\n"); - bus_dmamem_free(req_queue->dma_tag_ucd, req_queue->ucd, + bus_dmamem_free(req_queue->dma_tag_ucd, ucdmem, req_queue->ucdmem_map); goto out; } @@ -222,7 +222,7 @@ ufshci_req_sdb_construct(struct ufshci_controller *ctrlr, if (bus_dmamap_load(hwq->dma_tag_queue, hwq->queuemem_map, queuemem, alloc_size, ufshci_single_map, &queuemem_phys, 0) != 0) { ufshci_printf(ctrlr, "failed to load request queue memory\n"); - bus_dmamem_free(hwq->dma_tag_queue, hwq->utrd, + bus_dmamem_free(hwq->dma_tag_queue, queuemem, hwq->queuemem_map); goto out; }