{"id":2221472,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2221472/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260409133303.31875-2-ansuelsmth@gmail.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.2/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260409133303.31875-2-ansuelsmth@gmail.com>","list_archive_url":null,"date":"2026-04-09T13:32:57","name":"[v6,1/6] misc: fs_loader: fix ubifs not unmounted on dev_get_priv error","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c99bec27a90482e924d42db81ef097a24e0a1ef0","submitter":{"id":71108,"url":"http://patchwork.ozlabs.org/api/1.2/people/71108/?format=json","name":"Christian Marangi","email":"ansuelsmth@gmail.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/1.2/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260409133303.31875-2-ansuelsmth@gmail.com/mbox/","series":[{"id":499303,"url":"http://patchwork.ozlabs.org/api/1.2/series/499303/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=499303","date":"2026-04-09T13:32:56","name":"misc: fs_loader: reorg and split to FS and FW loader + FIP loader","version":6,"mbox":"http://patchwork.ozlabs.org/series/499303/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2221472/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2221472/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=nuJ9uQx7;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.b=\"nuJ9uQx7\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com","phobos.denx.de;\n spf=pass smtp.mailfrom=ansuelsmth@gmail.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fs19G09Q8z1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 09 Apr 2026 23:33:38 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 8A44E84181;\n\tThu,  9 Apr 2026 15:33:24 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id BFD098416F; Thu,  9 Apr 2026 15:33:22 +0200 (CEST)","from mail-wm1-x330.google.com (mail-wm1-x330.google.com\n [IPv6:2a00:1450:4864:20::330])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 9A4F4840D8\n for <u-boot@lists.denx.de>; Thu,  9 Apr 2026 15:33:20 +0200 (CEST)","by mail-wm1-x330.google.com with SMTP id\n 5b1f17b1804b1-48374014a77so12226655e9.3\n for <u-boot@lists.denx.de>; Thu, 09 Apr 2026 06:33:20 -0700 (PDT)","from Ansuel-XPS24 (host-82-61-192-155.retail.telecomitalia.it.\n [82.61.192.155]) by smtp.googlemail.com with ESMTPSA id\n 5b1f17b1804b1-488ccf9b919sm52876215e9.0.2026.04.09.06.33.18\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 09 Apr 2026 06:33:19 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1775741600; x=1776346400; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:from:to:cc:subject:date:message-id\n :reply-to; bh=ncf5CGqxvO5twq8XmgDTVmMycW8ixnJNHA/TGHwyw7Q=;\n b=nuJ9uQx7T7uaKjGC1xe9t9SmVWodqezP1yYMmi1BiMUq42QFVCROFD+/dVEyYISocC\n Bn9kpsM0L7mg/V70ipevS1lrb+9YYpAgtyxM81RHPaeJzga3P986IB0WlxdL+o3uNCrU\n V03WrSI/9oUHQGQe1NhRdY1OM5KxXb78xC5klwYTDvcyOgaO28PKx6N/m4p0YUoDmXyG\n Xh6YGqJeGAblCaTt3EOniSK71G/cM6GH2cUFFCUsLvmEXzxgMl/a1pwZ9iN+CB4fooOW\n gBrsOd9VoDV8kkQdI/626yi6OUrlDWTi6wJxvzi6mznRfSeMuNoDUvn5wlcolDOALM/i\n UPAw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775741600; x=1776346400;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to\n :cc:subject:date:message-id:reply-to;\n bh=ncf5CGqxvO5twq8XmgDTVmMycW8ixnJNHA/TGHwyw7Q=;\n b=MK0xcCNifL87O3eMzCsLnEw3njfL/juotEwEN97J+45ZYl6RKmtXxQnA8MPHEmw9f0\n ph4D6LJSyS1f1nPcJxSzNVvl/jfwMbGMOGYGYp3v5PtCMBX9uyVlAh1vltRVdYBNroyu\n dAO+bOzPg+M+T9/D+4hgEBJZql6A4w8kbohtfZ9Sps40TAW2q3cwhe2jVoEpFEiQp1E6\n lSE67JmyotAmBOYi5wY5VvpsFVSwXt6VXBAOITW2cx/bxXTh8y9W1kSFZi4/p52nPw29\n sSv0IQqIDPaTqWM/OK7jyvW9PUjeDG1H0UGUeEoHjaZ5Fr5hUT5P+SpWJIljY1v2VoG2\n 8F4A==","X-Forwarded-Encrypted":"i=1;\n AJvYcCUfRNMZcCMi7OlQcZas4F2SKS6u4uDVwC+cD32C3iW2xOZljob/1aPFMCj7v2aEHQJ68cM0fA4=@lists.denx.de","X-Gm-Message-State":"AOJu0YzOK2V0fWupBZFkuvRt0ZcKI5MjibXzHpnQccTvabloTozr+sHM\n k6okhwSzvzOxbhXFqABuf7yDbQu/nw1ROhD6hO0Ho9QYKKPytMaDerBA","X-Gm-Gg":"AeBDieuQIDuMZ9v9fn+n8RPhJTsRZ7R1HqML8QrSLV6ZM8qRE/WXg4SrpAKNPf9dbuT\n pyBP7SqcIyRxuNjT5bw3LwCZSTD0MeODFnJAA3mplMkcCBOAnopeu0RB/R4SxaTS5eurVNjnxip\n EhdOj34py8DHXfUgkQurNTRrKV/2346nai/9MotUeMcFI5Q+3CSjHp3Mrv97oQ5q9sM3yoy0hrf\n jRIqe5l9RhkNJO4LMWfVMvLcPOflUMSfRJzWXuVx75tzMdRYBRSajslc8c1Vnl0blPXlhzknfRR\n MwqZa+TeaBDI1pMxrcDukgM3fgDBbceu5uXri3P1IxOz785KuEqSD0YuNLWxV5gdSZeaVhEZu4+\n TFqvuraa5JKt9mmeP1RQighgkzpYvtTIoCCAxibB90Rd/nzKEEwQ88i9N3x8QhHN+ABYSs8e6w+\n fWPTFWS1Ay3FN4Un/wVzmJG4taQ1CHEavbQCI3ep6o4qV7yO8yv5h5JY0o+SSrG9yM0JA1dmU=","X-Received":"by 2002:a05:600c:42c4:b0:488:a82f:bbb4 with SMTP id\n 5b1f17b1804b1-488a82fbd86mr163806475e9.26.1775741599851;\n Thu, 09 Apr 2026 06:33:19 -0700 (PDT)","From":"Christian Marangi <ansuelsmth@gmail.com>","To":"Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>,\n Christian Marangi <ansuelsmth@gmail.com>,\n Casey Connolly <casey.connolly@linaro.org>,\n Quentin Schulz <quentin.schulz@cherry.de>, Peng Fan <peng.fan@nxp.com>,\n Kever Yang <kever.yang@rock-chips.com>,\n Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Mateus Lima Alves <mateuslima.ti@gmail.com>,\n Jamie Gibbons <jamie.gibbons@microchip.com>,\n Neha Malcom Francis <n-francis@ti.com>,\n Justin Klaassen <justin@tidylabs.net>,\n Leo Yu-Chi Liang <ycliang@andestech.com>,\n Weijie Gao <weijie.gao@mediatek.com>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>,\n \"Lucien.Jheng\" <lucienzx159@gmail.com>, u-boot@lists.denx.de","Subject":"[PATCH v6 1/6] misc: fs_loader: fix ubifs not unmounted on\n dev_get_priv error","Date":"Thu,  9 Apr 2026 15:32:57 +0200","Message-ID":"<20260409133303.31875-2-ansuelsmth@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260409133303.31875-1-ansuelsmth@gmail.com>","References":"<20260409133303.31875-1-ansuelsmth@gmail.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"When dev_get_priv errors out, the ubifs is not umounted (if used).\n\nCorrectly handle this handle condition and while at it also return -EINVAL\ninstead of -ENOMEM as a better error since no memory is allocated but is\nactually an invalid scenario for fw_get_filesystem_firmware().\n\nSigned-off-by: Christian Marangi <ansuelsmth@gmail.com>\nReviewed-by: Simon Glass <sjg@chromium.org>\nReviewed-by: Neha Malcom Francis <n-francis@ti.com>\n---\n drivers/misc/fs_loader.c | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)","diff":"diff --git a/drivers/misc/fs_loader.c b/drivers/misc/fs_loader.c\nindex 6af4c7f15e7b..cd4695b08eea 100644\n--- a/drivers/misc/fs_loader.c\n+++ b/drivers/misc/fs_loader.c\n@@ -175,8 +175,10 @@ static int fw_get_filesystem_firmware(struct udevice *dev)\n \n \tstruct firmware *firmwarep = dev_get_priv(dev);\n \n-\tif (!firmwarep)\n-\t\treturn -ENOMEM;\n+\tif (!firmwarep) {\n+\t\tret = -EINVAL;\n+\t\tgoto out;\n+\t}\n \n \tret = fs_read(firmwarep->name, (ulong)map_to_sysmem(firmwarep->data),\n \t\t\tfirmwarep->offset, firmwarep->size, &actread);\n","prefixes":["v6","1/6"]}