From patchwork Tue Sep 10 13:29:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Majewski?= X-Patchwork-Id: 273875 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 32EFC2C027A for ; Tue, 10 Sep 2013 23:30:53 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9E2654A064; Tue, 10 Sep 2013 15:30:48 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2UBOmmzULshX; Tue, 10 Sep 2013 15:30:48 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8FA784A0A9; Tue, 10 Sep 2013 15:30:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B041D4A023 for ; Tue, 10 Sep 2013 15:30:13 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HK+vRSaM1l6z for ; Tue, 10 Sep 2013 15:30:06 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by theia.denx.de (Postfix) with ESMTP id 13DA04A062 for ; Tue, 10 Sep 2013 15:29:59 +0200 (CEST) Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MSW00HAAW5XSIX0@mailout4.samsung.com> for u-boot@lists.denx.de; Tue, 10 Sep 2013 22:29:57 +0900 (KST) X-AuditID: cbfee61b-b7f776d0000016c8-8b-522f1ed5cdad Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 30.9C.05832.5DE1F225; Tue, 10 Sep 2013 22:29:57 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MSW00KJLW5HFV70@mmp1.samsung.com>; Tue, 10 Sep 2013 22:29:57 +0900 (KST) From: Lukasz Majewski To: u-boot@lists.denx.de Date: Tue, 10 Sep 2013 15:29:22 +0200 Message-id: <1378819765-20159-2-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1378819765-20159-1-git-send-email-l.majewski@samsung.com> References: <1378819765-20159-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprJLMWRmVeSWpSXmKPExsVy+t9jAd2rcvpBBruvGVrsuHOf2eLNI26L Nw83M1q8aWtktNh1ezKLxeTF85kt3u7tZHdg95j3cyKTx7xZJ1g8zt7ZweixbtpbZo++LasY PY7f2M4UwBbFZZOSmpNZllqkb5fAlbFizSz2gpNsFXsfLmNtYFzM2sXIySEhYCLx7vdcJghb TOLCvfVsXYxcHEICixglft56DeV0MUm8m/6XBaSKTUBP4vPdp2AdIgISEr/6rzKCFDEL3GOU eNSxAWgsB4ewQIDEv4lyIDUsAqoSDR+vMYPYvAJuEs8fbmKE2CYv8fR+HxuIzSngLrHwz36w +UJANR+X72CZwMi7gJFhFaNoakFyQXFSeq6RXnFibnFpXrpecn7uJkZwgD2T3sG4qsHiEKMA B6MSD2/AMd0gIdbEsuLK3EOMEhzMSiK8XOL6QUK8KYmVValF+fFFpTmpxYcYpTlYlMR5D7Za BwoJpCeWpGanphakFsFkmTg4pRoY18lopdj0lXHyeiZFB3r0GdjWz7O7N/lLp3f67sWzFxWc dd0p9o29eZ9kSMOE31ccAvvOikekis6PWKFullspva0yr3B2LaPiRyY2Q8VNtgumHbfakr1x 6+7TOjlWvAGP2Zsv5DvcVDFdvy4rYvl2o4tbn0T0qRp1ijwVvnAlfPWq/9vkjmorsRRnJBpq MRcVJwIAzvTg0ywCAAA= Cc: Marek Vasut , Pantelis Antoniou , Tom Rini Subject: [U-Boot] [PATCH 1/4] dfu:cosmetic: Fix printf text for buffer overflow condition X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Correct error message if overflow is detected. Change-Id: I8a915c7353d49822c046fbc36241237b370e6c98 Signed-off-by: Lukasz Majewski Tested-by: Heiko Schocher --- drivers/dfu/dfu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c index d73d510..2f1e2af 100644 --- a/drivers/dfu/dfu.c +++ b/drivers/dfu/dfu.c @@ -153,8 +153,8 @@ int dfu_write(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num) /* we should be in buffer now (if not then size too large) */ if ((dfu->i_buf + size) > dfu->i_buf_end) { - printf("%s: Wrong size! [%d] [%d] - %d\n", - __func__, dfu->i_blk_seq_num, blk_seq_num, size); + error("Buffer overflow! (0x%p + 0x%x > 0x%p)\n", dfu->i_buf, + size, dfu->i_buf_end); return -1; }