From patchwork Fri Jul 13 13:35:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 141887 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp814726ljj; Fri, 13 Jul 2018 06:35:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcygwtmzHIEd5QVrlpEWN+s50pHjL1duiscSBYs2B69y2VCY1mDAhn2XjwCDp07P54dH9hC X-Received: by 2002:a50:c251:: with SMTP id t17-v6mr7125408edf.108.1531488956244; Fri, 13 Jul 2018 06:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531488956; cv=none; d=google.com; s=arc-20160816; b=sImgy/nb0mUAisfihRf96gkeD65KiqzgZTQLIEJ90p079bT29z8ifJRUOloe0iuB8p ab2uKbvFaqwNmiGDx4TWOHpoX9G9xzOLS9Y6yANQVPT83j3LQ2nofp+PgQietQWTrdrC dVzAky8F9bgVj4nGJEypLBzvUiTYDl0EM0adAuNYqzA4egIumJz7P1kjPQbEWMNhpVl0 5mamBBmfZGayFPCqusoNeP11S5NykKY0ngeZI0lRLq/9XlaKwHplmG+tprOwa6rXwG/e qxFeZM+HrTMBu+Flja3UxL2bQsR//YyGPMDxLWfj9k74ml4rYT0+QFGTBfik9bucxLds NS0w== 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=yh48wr8fFwko8T9uHQWxhXpSVyLn0tKma9Fs79RSewQ=; b=PGBZos4OPSAgobdKIsbNaZM8bgmhXq1nD3hB+hFRwhmZAfFR7/AMhTQgpzuEJIu2Z5 9WwIIxmMvN1Y/DQntSo8XLz+CXD1Nw3LBqXxyZX9r5JFJ2NW0j9GEAygYfsDmgAhWAEr Jhg//1GDQbWqp23T3f11+dGDdLJEgj6hMEG7H9AwgxQbVDycXaIypJIFB90sRY9mNlGl u7lQ8XuHSziGmcNj8QdrwPCbmowDiDo4LCooS/KraXHCMCm0tU6w7cU2pRChgTyHG2yY F3ABp3jk8Y2E1OiPtCQv+VoZTa5BpfkT6P+9v8YPn2IY8rwuS7IVkQucs942hXPgeDew Q+PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=aEd19Bmu; 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 x42-v6si343942edm.81.2018.07.13.06.35.55; Fri, 13 Jul 2018 06:35:56 -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=aEd19Bmu; 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 CEB47C21EB9; Fri, 13 Jul 2018 13:35:54 +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 4E951C21EB9; Fri, 13 Jul 2018 13:35:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id CD938C21E44; Fri, 13 Jul 2018 13:35:50 +0000 (UTC) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by lists.denx.de (Postfix) with ESMTPS id 5E976C21DB3 for ; Fri, 13 Jul 2018 13:35:50 +0000 (UTC) Received: by mail-lf0-f67.google.com with SMTP id l16-v6so27197156lfc.13 for ; Fri, 13 Jul 2018 06:35:50 -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=VMo0yXRM4KjaXgHSnH19Kh9e4JE0IL1WbYopGfpXah4=; b=aEd19BmukObn20N3uSkE5Se1v1TISE3rqiYd3irv/mzwZaVyjGZMFimniSnKsLl+EN zq5wVEUzB+rMW0XZft9MG0sVTs1fI5cWTXYLXOid0EB5L4RNAOOErD1FShN7PADQ25+e 3VhqdHsnARTCXG55uQwHZF7ZGa9HyqECnKEdU= 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=VMo0yXRM4KjaXgHSnH19Kh9e4JE0IL1WbYopGfpXah4=; b=kwJtq/uoCuuMPTQXepdavU7T+1LADLj/fyMlzQmguTpe4n9CmX1vk1M+6mBUwC/uXf v4z1xtTU3soQW3AOzwXFm0wpCfISLGbW7RQw+rdeZ5CkPv+cMKL+MbFbm1z68rEwB70Q bdPasCF9IRpogTWzhiFpSq63n2InFjaOdY0EoahAQqpxG9dNzqpYA0ufbnuPHD1FygS6 JmiivTT6ugXq3FNjdrg+9RtkobFzXtKD9kGIgEamI8FnwNQ6M+RlEpbo6Op/e04AXyCQ 5063xcAycXZ26IjXgEoEBC0/IWr9i3HKHfdDL+favsLsHaGqZCPfcqB2BK7xmwSOd1x2 s3uw== X-Gm-Message-State: AOUpUlFYNJbfzzvERy1QrEQr8fsGzqMKSWPNooTqkIloVxzG1+J8bK5/ 744+Uvu6/LUou8xvcyrQd0sCM0Vk/qk= X-Received: by 2002:a19:4c57:: with SMTP id z84-v6mr4917876lfa.67.1531488949475; Fri, 13 Jul 2018 06:35:49 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id i65-v6sm2920503lji.88.2018.07.13.06.35.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jul 2018 06:35:48 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Fri, 13 Jul 2018 16:35:45 +0300 Message-Id: <20180713133547.21094-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.18.0 Cc: Tom Rini Subject: [U-Boot] [PATCH v2 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" Commit 5d8fae79163e ("dfu: avoid memory leak") brings a regression which described below. This patch is effectively reverting that commit, adding corresponding comment to avoid such regressions in future. 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 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(). Tested on BeagleBone Black (where this regression was originally found). Signed-off-by: Sam Protsenko --- Changes in v2: - Improve commit message by mentioning regression commit 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 Fri Jul 13 13:35:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 141888 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp815144ljj; Fri, 13 Jul 2018 06:36:17 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcf6292eYMRYb73p9TCmthSPjokSXy1y4n+G/DTtgcPxFNgrYOb2JxxodRvdWWedJVY1jtg X-Received: by 2002:a50:88a6:: with SMTP id d35-v6mr7288317edd.239.1531488977615; Fri, 13 Jul 2018 06:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531488977; cv=none; d=google.com; s=arc-20160816; b=C2SD8cKaPn3y2dHasS+bRi0nAe6FJ9J7/J0xkqyS4dyXdEuU44TmxE8CbQC9+z/ecE AtQSU8kR2gN/BvwScDbVUr9bFTYoNs74RqWY6oFr5UtSbEe1KhyhMoyzf39Qp4rIuEHW n+S58zx0etadYFrSDv+Umj055ImKAp/7A1/nREQVI0DLWJPPht9ADwgdRqXsDlGkQIf1 80BpxTeBb6jqj0pXH/2/i9zqF/bij3OY35kMU73dvQfDSZ1qxtvNWbTr6AK8e0eC35CE lU3j+++QNq5BIf9KQKe0T+v6lk385pnsHD5aUr7HUY+lnHcHaN7VYPG7ZnLU+eFfbrZN UJ/A== 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=5fQn9IdkJu4M6+ARZXkWnmxCyzsnehG6jCoxAjnSCag=; b=Uby6Io6NH2tmcvGpNMjBt6tpuHz4OYOP60I0aeCGJUk0Lk/xqt4h7l+ReDa3Vg3+0U lyJGE2HJwEKlqx+L/K7MyyotIiaqehMdd0ppi+MMq3KhOkggAYB7nKcZlWDD5iJuCg+5 MCzvl0JUcJmoDtCJ2WsevfHQqkmb9dnRHK5M9ySrxttcFX6y20g+6Dib1qx4Pl8IweSL 6kZsA4VEcQNfCTZ3RmqJq3km9gXZwsSpdbmWGhgf8ksazCWgmI8IkYeHsXuPGsfRvaJM 1CM/2Pro8jrvDHrYq7WEklIDStQ0X8gsz+t15J9qdLzev8CDCcdzgIym6oVWNryvLE8i SK2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=M8UkMSc0; 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 d11-v6si2687851edo.400.2018.07.13.06.36.17; Fri, 13 Jul 2018 06:36:17 -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=M8UkMSc0; 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 2CE3AC21E44; Fri, 13 Jul 2018 13:36:11 +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 3910EC22059; Fri, 13 Jul 2018 13:35:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3BB4BC21E44; Fri, 13 Jul 2018 13:35:52 +0000 (UTC) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by lists.denx.de (Postfix) with ESMTPS id D976DC21DB3 for ; Fri, 13 Jul 2018 13:35:51 +0000 (UTC) Received: by mail-lf0-f67.google.com with SMTP id m12-v6so27189170lfc.10 for ; Fri, 13 Jul 2018 06:35:51 -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=Z2YlSjN4RoV9gSr2+KJC7MCILVkRHTCAcGGxfEuqVkQ=; b=M8UkMSc0EtCbAAIl28PIi+PD6lb1/lr3EodJX+XsnMxXsCKetzNktuu6lAXFLtTHmt MIeNwEc+ROGrdejxcMUM2m6tZkrUFvirob/2OsxAkny7X57O5hWrnJ7mhJTKT261sgtT whqhUoRhgEWesuosC8reB+pjSvyA5Zj14BqWg= 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=Z2YlSjN4RoV9gSr2+KJC7MCILVkRHTCAcGGxfEuqVkQ=; b=NQpHMltCccx65DTSKC7+dNheYbUG8s576wtp+ovAF97zED07SDzDb/w4F1AqRnfgKr 6jxdSjRdljVngfFPEbxE137nLlwJTflLIbeLCTIKjSb73GzUocZFhkZgOAsmW9LlxM9l tlCkhv/KR7S+8lZ3+yObkynAIlYzgKMFqgRVZsW6i1VqeW0Jyfzm4nS3BmE0J/png2Zc YGdG9Rj/g+DhilsnXus+sBuqm+7f+ZXMQBbPE0D2SYkbTnma3R6HP1mRG+4Z6e/T1Xkv 5+ifrgZ1TDPC1isge8tbxymmqXegZR+NwyVuXOKzW2Wqo19t1ThmXHtHVbf3yIOww3j4 XoTw== X-Gm-Message-State: AOUpUlH65RwTiqOAD4Ga++kSXyrfF2Syq5PANHD0ps0PQI6PoZRQ+rLS DoxlX950td/0n6B1BmIPB2dF9G+OOtE= X-Received: by 2002:a19:d7d1:: with SMTP id q78-v6mr4954524lfi.40.1531488951082; Fri, 13 Jul 2018 06:35:51 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id w2-v6sm2576350lje.73.2018.07.13.06.35.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jul 2018 06:35:50 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Fri, 13 Jul 2018 16:35:46 +0300 Message-Id: <20180713133547.21094-2-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180713133547.21094-1-semen.protsenko@linaro.org> References: <20180713133547.21094-1-semen.protsenko@linaro.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v2 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 --- Changes in v2: - None 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 Fri Jul 13 13:35:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 141889 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp815931ljj; Fri, 13 Jul 2018 06:36:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeIHLL2qENVaD1CGeywC3tV3zQs888RFrruYmGMCsB4qWl7S+SSABn/6W1Y0HyvyPL40ash X-Received: by 2002:a50:a542:: with SMTP id z2-v6mr6905501edb.77.1531489019458; Fri, 13 Jul 2018 06:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531489019; cv=none; d=google.com; s=arc-20160816; b=t14jSE2Ujx61tkfINr6w/TUKQfn0QlbjY6+so3CREG0QcNHZnzfZOn57i/T2da7YTX dFunFjGPcKzcfHFJSQy45Fd0f3AHmJp3j/Vpv9nScDcsLaQgvruTT9R201DjGzIcV1xJ zCFMsHN6hkuM8zg8rXt+Ag49D3yO/Eob20siMo5BvM80N8ITcLfbc0ZcoRuIqJ5SrlY2 c2zfECRTuA7f+LvEvEJybq7cBx2blr6C0741pDnx47hoSE+qa1RCwg85doZ/mqKTUIu9 uE2aScJJanRWjyGhziVetQcp7updvjmKDCSTXBWyW64oc6nxR5npX3geVuJnMxE1v+B1 W/bQ== 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=D46np50gjDFrZBs6EDArHsM3tAAoY/Je3DVo6Z5g9hQ=; b=RuEIXPohMaJ2VcNv0HOEX0BZBTOU8i+mnohRJoyifvAMQcS39rfQRVme96IcZBwxmU v9M1PyXOMoeDX4ydyVymXsHfM8yeqcwrDOBlNyvKaUb6E/t19OCFk+yBX7wByDYXlpuh hOMIYFSFjfCDGpMh0LxY+ZhspuMK3YPH1olp2YFnN53J6iG2MAnsQNApFRV0HBzlkYjS ahPNGVn8jtCU5dPtk5ucDo7za8M+2Q0lRmRz9aBRnm63RVcsprV9/+FC/58MQ+jQ+oJs zVd8+d83GSbt5tSOhe/j4otxCKXa1IU9u3oOo2uxoTanN/ootQjaeMMyGNDVFOGngToq A/AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KtsEoyrg; 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 i31-v6si142983edd.265.2018.07.13.06.36.59; Fri, 13 Jul 2018 06:36:59 -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=KtsEoyrg; 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 0F30FC22065; Fri, 13 Jul 2018 13:36:28 +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 083C8C22045; Fri, 13 Jul 2018 13:36:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D08E8C21DB3; Fri, 13 Jul 2018 13:35:56 +0000 (UTC) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by lists.denx.de (Postfix) with ESMTPS id 73A6FC22035 for ; Fri, 13 Jul 2018 13:35:53 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id q127-v6so23956934ljq.11 for ; Fri, 13 Jul 2018 06:35:53 -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=7R2oWp/eXfkMYmwTVLLRQ2UJz9ZmFcTelQygGRvV01M=; b=KtsEoyrgZrFkLxdBWL30t/d636Cz9ionKPUmCJKnkoHCL+q7duc4L7repNCDOEZS2F ukv+XGaTxRtQZsc3+SDFZnnzKLVXlnllsoVAMJgW7B7iywZ2ol7bw9TAGNLIh4lLXJUD GQvhrgvM5Draww2jlWaYqG1IUg1MGCFMiPxOE= 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=7R2oWp/eXfkMYmwTVLLRQ2UJz9ZmFcTelQygGRvV01M=; b=qyjob9eHls75Qi4MZgWc79lH/Tbopmu65gy6pMMNmrIeGDnChgxLZlHAsp/hQlB8PG dH88FFMqQSt8dgnJT7mHs2pjF7jZWMAjc9zlhe1E2YDvTQFzYxkkZvj7po7jiHcv+m5/ kdY1S/CJMI+oBWyVTGD0bikfIjEGPkrSpmxwA2WHoXlRa5j1xTlfS6SyduoupalhbfdY 4MDqdcjefV5tpTJ50RMq3qIeW6Qb9v5QLwCkY5FTCPFMuDKeClV1uJmgsIsttIJ4SWmh SBYW/f8ZluRMEj4xNUZjjw8jFbnsJ7VsnQh5daLcnkGf84HeW2kcqi+FS0Qj3OmCkBVw P5lw== X-Gm-Message-State: AOUpUlHj+G+NBTUrrFsY1vb4utmGP9WTbyqD2LbGbQI+jU3PAriN1mXC +zL5StOLdxewrbl9LP6UoRJj415qk4U= X-Received: by 2002:a2e:6c07:: with SMTP id h7-v6mr3436322ljc.81.1531488952616; Fri, 13 Jul 2018 06:35:52 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id j26-v6sm2674639ljc.54.2018.07.13.06.35.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jul 2018 06:35:51 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Fri, 13 Jul 2018 16:35:47 +0300 Message-Id: <20180713133547.21094-3-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180713133547.21094-1-semen.protsenko@linaro.org> References: <20180713133547.21094-1-semen.protsenko@linaro.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v2 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 --- Changes in v2: - None 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; }