From patchwork Thu Jul 12 21:52:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 141838 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp69113ljj; Thu, 12 Jul 2018 14:53:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdj+daWTSJ3oKQojLcBRn8bfObX92+EQw24hkQDG/y1ppa+g0yYzVKU5JrVwZu13CDZAU9c X-Received: by 2002:a50:a2a6:: with SMTP id 35-v6mr4271435edm.276.1531432382287; Thu, 12 Jul 2018 14:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531432382; cv=none; d=google.com; s=arc-20160816; b=n1Tn7qy2OFnn1SqhT0jAC0gY0tDIqhIuZ9RJoMyh+EUCmI0+vCaEuVfDhG4cc6Gtsa ibyhA4mXPsE3lPf3D5XuPhDr1fAF5WAGcInhkfv9cOUGfliAlWYEb7rLwUF/MSQsVF1q yFNFiKKJdp21PTALUUoMeF2htd8QmACvueJdRW8ITMlXBjvp2i6L6I8Rh0d5v60Xr+ij bAtcoZIeYb/1fRmRAO8bbDSXsi9X4ccXc4Ckw2iYE+AGzgwd4alemijLMw9hyP2cqgUZ axtCFqjPsEWK9omgQmBLiGoPj+5aWKd8DbTO78juuA8o3TNvX44FyRcL4L9CJqf6FfBe /jlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=Hwnt56RQppDGrQ6xYnbjhuaqUQpAKBKrhlvJy+ZZgKE=; b=vr80A80iwlcGRPsAx+M7ADUXwqEF/QDR34zCpJb6Q2XhJRwof+Pmim40gMxNhS3SkV hpT1V9Hk9hCL9jaoLWunwAreAQ2K06kpni5tgxqc8VwLRttjnWJU7JcB/JvNiVvxbdSs u9FEyM2Du2YxwKc6kQ/XENKX1g6aVCkn66txnuFUSzST723fmEHJCgH23aEH80JHpphK wzAWhf1JS5i9z4LWl2QjF92Q5FbYRHFU+ZKpv3KXFlX2W0AQnyixYofkl7Hwky6nmDft 7qUqkM8/yoqGVxt6Gwfvxl6EGkLn+oRyHyb3XuTwt9a5vErvu1UVyBJalrVbGJsuTePg SQAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fK40JjGu; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r52-v6si337770edd.119.2018.07.12.14.53.02; Thu, 12 Jul 2018 14:53:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fK40JjGu; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id D26D3C21F9A; Thu, 12 Jul 2018 21:52:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8BA80C21DA2; Thu, 12 Jul 2018 21:52:57 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 743F0C21D56; Thu, 12 Jul 2018 21:52:56 +0000 (UTC) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by lists.denx.de (Postfix) with ESMTPS id 19353C21C57 for ; Thu, 12 Jul 2018 21:52:56 +0000 (UTC) Received: by mail-lf0-f68.google.com with SMTP id y200-v6so25488326lfd.7 for ; Thu, 12 Jul 2018 14:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Ci2F9n5YN2dcoacFO0xdMAzqHklUx8GCdYfpO1fbmg8=; b=fK40JjGu2I2mmrp3qTVw0xH/tR0RIjBv1tW5mNgq+ZJmH2tcLnbHeGNJXNdVed34qf JLId8V0FBoSfLHUnkG7scYOhqknjyhn1MNOGa2Jj/iZpJcoIvhSlsCwywZr/0JGCUceb RXSV+aIGAzrTU980sju2347jfFnrXYn0KUbNs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Ci2F9n5YN2dcoacFO0xdMAzqHklUx8GCdYfpO1fbmg8=; b=VhRZPPvr5f8SZhvIkdusJuNGmehzQa+LqmXVi3HmAt7pmObiF2VKslc3CpeFx/RVnZ H3XIt1F7kmqF03apk+hV049/MVTRkoZwBzxVVD5Mj0oyJd1sLBxPxCnpPgpZxVja7bZm J0SCV6g+l+djdQo6vbatERXXXdn/TbCbjQEFCGPVbntzFz6rSDyp0v4/rH/TvquP8k8s jVCjR6j/lOzvZTahJZHjHdtaYC4MBblbznXb9RbdPMQbMoIOYVHou0y0aTGF3rTu6bQI Y2gBwNNx2c6xf1gw4KMFtNNYuoksnB/Nzv3sYZyZrEKNqNLEWUm1XEHzAr1bLWmILeqM lqaA== X-Gm-Message-State: AOUpUlHZZ/TYLVwp533MF/L2r6TticsdHWdbfF7x28nmODPz/pGP4qUz 5tASeNWJw/yElHeMBsy3zEb8JnslrSs= X-Received: by 2002:a19:4344:: with SMTP id m4-v6mr3231065lfj.111.1531432375084; Thu, 12 Jul 2018 14:52:55 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id p24-v6sm3537223lje.0.2018.07.12.14.52.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 14:52:54 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Fri, 13 Jul 2018 00:52:51 +0300 Message-Id: <20180712215253.4290-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.18.0 Cc: Tom Rini Subject: [U-Boot] [PATCH 1/3] dfu: Fix data abort in dfu_free_entities() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In case of error in dfu_config_entities(), it frees "dfu" array, which leads to "data abort" in dfu_free_entities(), which tries to free the same array (and even tries to access it from linked list first). The issue occurs e.g. when partition table on device does not match $dfu_alt_info layout: => dfu 0 mmc 1 list Couldn't find part #2 on mmc device #1 DFU entities configuration failed! data abort To fix this issue, do not free "dfu" array in dfu_config_entities(). It will be freed later in dfu_free_entities(). Signed-off-by: Sam Protsenko Acked-by: Lukasz Majewski --- drivers/dfu/dfu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index e7c91193b9..a3c09334b7 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -462,7 +462,7 @@ int dfu_config_entities(char *env, char *interface, char *devstr) ret = dfu_fill_entity(&dfu[i], s, alt_num_cnt, interface, devstr); if (ret) { - free(dfu); + /* We will free "dfu" in dfu_free_entities() */ return -1; } From patchwork Thu Jul 12 21:52:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 141839 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp69675ljj; Thu, 12 Jul 2018 14:53:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcyJ9T/DuQf1ASyOQ3mw3fA4cyVrcXNswaiXGx6pjErdTnZhfP96b4/GU8lfnwqipc281Tl X-Received: by 2002:a50:95ab:: with SMTP id w40-v6mr4087326eda.33.1531432438694; Thu, 12 Jul 2018 14:53:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531432438; cv=none; d=google.com; s=arc-20160816; b=xN3+lScuF/UOhDK+eiLwPILIQ3rfKaUbx1XpUlDiQUsLiAUQ1RLtnHyAPGePVEIvL2 jiYJ0SfRJ8ZxbSmO5dkrv+sJrHRCE2ZrzERrK+YLPr4oOA0LUBu5x+ACu2tHXxymr784 bd+wtTE1MFIMbSVAkFx69RGNxilPdaDEV7OlNFZUVuYfZRlNmeh1q+ZGQDfPSX6hu1Oe 3Q4W3YRzbEaw/yG2d9iGE4jqFNcOV/h9JJtB90zO3l5kmOs+Mxglgncp4C5X3hlkjg12 PDSFtWEfKhPPw6D0kdMMXz2ZzrFf8fUzSPKk4gx99nO1pPV1B2MJUmIyltnDYuN3iDg3 sAnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=ONFZ9goB7dD7LnJ+PTgySZi69nGsDWOIqPycqyZuRYA=; b=q7Gs+7Lh/9gU85pSDOHk04s2jRO34Fnud/qoI98xgKmTcbv+eq6tqe0yb78svxSL6S 7rp/Lyis8fYM1LfdoTMuebSgUXzc381GZeJO5eGepfXglbJlybWPM4l1M3fNzw0bh7gC amZQcmwv1BNZqKPIFMuq7NjRzwx5AmqyCspJxTBh+4U0RFcpkT047SrKNKm5eLRsEdCo Wn+H22OpR057C2cjtjmVP1n/3rLLG1fwWT9qH3a1muyoWw0Tx7RBau5jKeCA622dtkS6 6UsM1YtbkJ0LzaQLqitMTofDXI3nLB3Dz2ZqH8z3ZqdEkd6vGZmFAYq37AYAIPnPOAqH Hj8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VP+EXhTY; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id s19-v6si2769600edc.383.2018.07.12.14.53.58; Thu, 12 Jul 2018 14:53:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VP+EXhTY; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 4A883C21FC1; Thu, 12 Jul 2018 21:53:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3753CC21FC5; Thu, 12 Jul 2018 21:53:02 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 01496C21E7E; Thu, 12 Jul 2018 21:52:59 +0000 (UTC) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by lists.denx.de (Postfix) with ESMTPS id 864EAC21D56 for ; Thu, 12 Jul 2018 21:52:57 +0000 (UTC) Received: by mail-lf0-f68.google.com with SMTP id a134-v6so25468388lfe.6 for ; Thu, 12 Jul 2018 14:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z/Zp2sXUf6MTt31h9qQF1whfdNvlIu9/DyEhonIqC9o=; b=VP+EXhTYfOAPjoYOT6kiZNFaCGJvfp8+70v7hVv2i+pwd3QVdLMDO1jZ1l+5idL+de Qz+ubhuIHELpJf1BfteM4yQbTVlI3xS+OemmPJqTGFWgZI1/4xnTesdLBNrGEpSXH4uL dZRxpCfwIoO7ydHLGTuyuDe7SNa6TRw9gC3z4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z/Zp2sXUf6MTt31h9qQF1whfdNvlIu9/DyEhonIqC9o=; b=XD50fB3i+5cEWEBaFxUppiwJfIzNiN3WwTi4lIfGgYL6Z2VUppI+8b786hhFPBCjH5 l+/lCokuX+tLkUhwaLSsNdlVtfgbI7PBFclzx25iqB+xBWYnYWG12bvDoA7JgURq5puB xILoZnISXlH6eE5U3zgMn2A3BqOM5StiUb4GrmtdLa48c1dQKQijiuUP6fcWZmh9eTL2 ytRCKAFs5U21V9yTKhbSnJ8cP2K84awvvCIjMfWfEZSyIoM6f0glStq1IvJc3cp+/zDQ /ykX3q0PphlxSIQ3iQZ4EqkwnEtv8uh0oma8Ey1xD790fD4A73EQAV20qR1EFNFRcdsP UUXg== X-Gm-Message-State: AOUpUlFgf0Onn94FMcVvZeoK+zG6XXjm++n35gOfUfErhbDQtrvnAp3w q0LdgnJ1Lk9UuoHRxkYDR4W94dHYP9M= X-Received: by 2002:a19:dd81:: with SMTP id w1-v6mr2944363lfi.114.1531432376760; Thu, 12 Jul 2018 14:52:56 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id p88-v6sm3495940ljp.90.2018.07.12.14.52.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 14:52:56 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Fri, 13 Jul 2018 00:52:52 +0300 Message-Id: <20180712215253.4290-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180712215253.4290-1-semen.protsenko@linaro.org> References: <20180712215253.4290-1-semen.protsenko@linaro.org> Cc: Tom Rini Subject: [U-Boot] [PATCH 2/3] dfu: Fix memory leak in dfu_init_env_entities() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In case of error in dfu_init_env_entities(), env_bkp will leak. Fix it by providing single return path. Signed-off-by: Sam Protsenko Acked-by: Lukasz Majewski --- drivers/dfu/dfu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index a3c09334b7..5b9abd685d 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -56,7 +56,7 @@ int dfu_init_env_entities(char *interface, char *devstr) { const char *str_env; char *env_bkp; - int ret; + int ret = 0; #ifdef CONFIG_SET_DFU_ALT_INFO set_dfu_alt_info(interface, devstr); @@ -71,11 +71,12 @@ int dfu_init_env_entities(char *interface, char *devstr) ret = dfu_config_entities(env_bkp, interface, devstr); if (ret) { pr_err("DFU entities configuration failed!\n"); - return ret; + goto done; } +done: free(env_bkp); - return 0; + return ret; } static unsigned char *dfu_buf; From patchwork Thu Jul 12 21:52:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 141840 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp70016ljj; Thu, 12 Jul 2018 14:54:33 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeYzMzgBXQPWZvy6mQMaJjlb1Ap8bbxUDRzI7kJD47ytHD8bSv1pGuKnJXaR/3ZXqTNo96A X-Received: by 2002:aa7:c742:: with SMTP id c2-v6mr4228799eds.231.1531432473909; Thu, 12 Jul 2018 14:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531432473; cv=none; d=google.com; s=arc-20160816; b=GowTc6Tnw8GjlffF7cAsv5h7ZSri0lLXnCjiK45ADNuiIlIUc9t1CDeNnaqgFyn5bi km5U3JH6aRmRN6aQv29ROlERNEicSmeZYQF/Wdv+x26iaX+lqqpr1F348ScdTqgca3Zn RTo1+/2dUGlb2fzIifuzc+MVuWLe00mIZR1MopsoSimvsUknCYjGxUgMSKjSsmmm3r+B Qio+A8d8qvtj/RUJd17XHS+lM5LuAvmgX9ruEqYmooZoGTe4hfKUMzmZSZk11ofdReVa VUnB+Wq2ShtfMYbgmW8NxZot+DskaJppyxwSvP2zML82vrON/IH5xVD7dVd6Izc8eRCT 4BSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=YUVH6CdhaWAAG52qnHEWgKqAa74u/1W6FWWTGzwqP/o=; b=rF7Q+5SL57acGmk/vzf4QQ6Yv4Yk8jrdy1pXSvzhvP4Vl/+TM7IIWORzIn0s+450dE eMFN1X0BOFGf8alR43n+ko6Wx0Qdra+ktdo4h3+c5m2pmnYLG1egoC3YC7eokb/ex5Pp MJgdgg0t02DbnH8+9G2xTcwGOc7JeTY2Z7cpV7v/4jzoqRt/xPCxbNiE9JLsLcyQXY21 FR6uyd3J7N2fqEkOAZ/Uu+x3eF3wfsvN798mjlweYa1ED1H8bYKb2RHjfNQJM/xq3KUf Qf1/MnrlUFDar7ERxVxXiHjlp7QdU1UGZqIFq/8kSLow7ak8rtmFeuSTqN4KGUxd1ZGt 9nsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WUokB4sR; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id e18-v6si483764edb.332.2018.07.12.14.54.33; Thu, 12 Jul 2018 14:54:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WUokB4sR; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 7F5A5C21E7E; Thu, 12 Jul 2018 21:53:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E68A8C21FC1; Thu, 12 Jul 2018 21:53:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 297CDC21F69; Thu, 12 Jul 2018 21:53:04 +0000 (UTC) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by lists.denx.de (Postfix) with ESMTPS id 33C3CC21FA0 for ; Thu, 12 Jul 2018 21:52:59 +0000 (UTC) Received: by mail-lj1-f196.google.com with SMTP id u7-v6so20453869lji.3 for ; Thu, 12 Jul 2018 14:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CncAm6Mq9V9tX6/19+coi07ISJDQjk0kgyWPG7YPTP4=; b=WUokB4sRIqI/Hn3ZIzc6sVkt2xxOieJq3Seu8pm/Kr1fwuY5HTe4cPKTvkq2dYx/p0 n+Np+lmObOWbq/zy/NjK3zZ7ZQW5oxVlrrXmaczNNc70D8zPYHqhrp2M1h60Vb0TGV/R axDMnjE8yLQ1qttmaPEOZd5RTyQlmB8TINZRA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CncAm6Mq9V9tX6/19+coi07ISJDQjk0kgyWPG7YPTP4=; b=d+6eG6c4wbfSoO9Azao8g3b3C4DCPKwrqjxnZoIRqu7TmzKvU+c8WeAJ2//+HXWwzR i7F79uY7nzhpYKWp/XXOZLbFDuZgWNjMSuA2zJ75lN9WtVDGZZ0Uh5Fnut190KQpDUZ9 C0xnucLi1TtHb7+0Ad5/Bon7xQ4XW5YKWgFfwzynoBtlEogRFPNNgVyy2UZJIyUC4+m0 xCOxMg+rtvNuI27yGMr6fVp0dkjtETRIWEU1yKPsJpkoTXQCSw+7qrKRZ/6GhfWZDY14 NK359GYEzc59I60/4xxFbvMkmLCBPATc7u03iJjCKybKMu65O/iSxScSvoyxxmuEdG8P X8qw== X-Gm-Message-State: AOUpUlEWn5XCuYatkxxmHMe6BgW0XZeutF1O/1bswI1A82HSGN93m+z5 xJTfdvIZlzBHiND7F6EYA/e/Vtx6wqs= X-Received: by 2002:a2e:144f:: with SMTP id 15-v6mr1555030lju.122.1531432378370; Thu, 12 Jul 2018 14:52:58 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id b3-v6sm6267021lfg.43.2018.07.12.14.52.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 14:52:57 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Fri, 13 Jul 2018 00:52:53 +0300 Message-Id: <20180712215253.4290-3-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180712215253.4290-1-semen.protsenko@linaro.org> References: <20180712215253.4290-1-semen.protsenko@linaro.org> Cc: Tom Rini Subject: [U-Boot] [PATCH 3/3] dfu: Provide more verbose error message X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" It might be useful for user to see some human-readable root cause message in addition to "configuration failed" message, so that the issue can be fixed quickly. Signed-off-by: Sam Protsenko Acked-by: Lukasz Majewski --- drivers/dfu/dfu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index 5b9abd685d..318949529b 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -71,6 +71,7 @@ int dfu_init_env_entities(char *interface, char *devstr) ret = dfu_config_entities(env_bkp, interface, devstr); if (ret) { pr_err("DFU entities configuration failed!\n"); + pr_err("(partition table does not match dfu_alt_info?)\n"); goto done; }