From patchwork Tue Jun 12 06:04:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 928108 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="RyLSNNaV"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 414fWQ3mCZz9s1R for ; Tue, 12 Jun 2018 16:05:38 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 37503C21DE8; Tue, 12 Jun 2018 06:05:33 +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 5273AC21CB1; Tue, 12 Jun 2018 06:05:31 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C1FFCC21C8B; Tue, 12 Jun 2018 06:05:29 +0000 (UTC) Received: from mail-io0-f194.google.com (mail-io0-f194.google.com [209.85.223.194]) by lists.denx.de (Postfix) with ESMTPS id 39A3CC21BE5 for ; Tue, 12 Jun 2018 06:05:29 +0000 (UTC) Received: by mail-io0-f194.google.com with SMTP id t6-v6so26684156iob.10 for ; Mon, 11 Jun 2018 23:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=8cQrACU+iTHei6rtFjtIfKO8C185Jz/sM/ziP3kjwdQ=; b=RyLSNNaVd9UTLX/DlE5yHF/2rsziGKoMzMgGQgkTAIKBZNKVdY0hkBXfC5JamomyXX /LD3gcK+ZGWCAjepBaFewwihZ5/jDg73ed8FG07HcJHP3iRjipoPjDdEi2Bngeo5d64Q 1SxgpbvsgkvdMqOuXRRmjNP2Hm1/r2bqScdfk8JkdB42BxzEbRfa4i6KmznEH3ylSgmA kqhNRDCE2aQwhuLa4vAqf94ETo9ZRBGeXF9byScnmplo3Kj9pC7f25e3TulmpozG9zHS O6x82woGnGL4n0sMjBujvsoQdiyO+x4u8Ff56HmyOBNM281lZf0kEp0jAjTJdpsdp6Gs VCmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=8cQrACU+iTHei6rtFjtIfKO8C185Jz/sM/ziP3kjwdQ=; b=dQnGOH0MCQYLRR+IPBkX3r7HMLFPx9PQ3KNZEJ8pfBPSoRPCrCO6lPLTWv/foiUUmg ZpNA8wAP5yvT22BWzHX0fASGaFiJZUpo1E8iEQqppubh4Bygm1y48fy+TjILOr9bfrrg O4LUYtulYXg32GgfulAp08CbtetKV4bfv32HFuIT5ldFOyEw5GjIAK/C+7TGJDi4Z9xY EZFdLgbo9HdHE9aZnQuVaMWj13qZmtqF85AwQuGTS+tBq2ccMBDSOibWht0vufSaiL55 Y0FongvUTSreZm9G6a2JPuwoU1nLIQ655grNhSC/YzwOY82Ye1vxj9fDVPQLlZCYzJNT T1XQ== X-Gm-Message-State: APt69E3WElmxYmCue0M2nugZB03tNuRGbniUxfba46dB5D4xreI61gyd FjsryPy+gI+RsPF7TPhEHuYYOA== X-Google-Smtp-Source: ADUXVKKizmkdXga3wWuKuHAVpOFBjemTrDLvx0i+an3oa4WxiSPhDrkLLZR2YHPB8yiEzxAoVE8qGg== X-Received: by 2002:a6b:b288:: with SMTP id b130-v6mr2127887iof.153.1528783527490; Mon, 11 Jun 2018 23:05:27 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([100.67.80.24]) by smtp.gmail.com with ESMTPSA id z68-v6sm22833ioz.79.2018.06.11.23.05.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jun 2018 23:05:26 -0700 (PDT) Received: by kiwi.bld.corp.google.com (Postfix, from userid 121222) id AF2B3140129; Tue, 12 Jun 2018 00:05:25 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 12 Jun 2018 00:04:54 -0600 Message-Id: <20180612060502.196817-1-sjg@chromium.org> X-Mailer: git-send-email 2.18.0.rc1.244.gcf134e6275-goog Cc: Jagan Teki , Heinrich Schuchardt , Tom Rini Subject: [U-Boot] [PATCH v2 0/8] Fix some coverity warnings 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" This series attempts to fix various problems reported by Coverity, in subsystems where I have some knowledge. Changes in v2: - Change log_get_cat_name() to always return a valid string, even if the uclass is not found - Also remove the leading / from the "/spl" path - Add a missing free() from one error path - Add a comment defending the technical memory leaks that remain - Fre the string when device_bind() fails, and presumably doesn't need it Simon Glass (8): log: Fix incorect range check in log_get_cat_name() console: Fix handling of NULL global_data sandbox: Use memcpy() to move overlapping regions fdtgrep: Fix logic of free() in do_fdtgrep() fdtgrep: Separate out checking of two allocations rsa: Fix missing memory leak on error in fdt_add_bignum() spi: sandbox: Fix memory leak in sandbox_sf_bind_emul() sandbox: swap_case: Increase number of base address regs arch/sandbox/cpu/os.c | 5 +++-- common/console.c | 8 ++++++-- common/log.c | 10 +++++++--- drivers/misc/swap_case.c | 2 +- drivers/mtd/spi/sandbox.c | 7 ++++--- include/log.h | 3 ++- lib/rsa/rsa-sign.c | 13 ++++++++++--- tools/fdtgrep.c | 16 +++++++++++----- 8 files changed, 44 insertions(+), 20 deletions(-)