From patchwork Sat May 8 22:00:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1475923 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Jo6m1PWQ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fd1WM60shz9vF7 for ; Sun, 9 May 2021 08:02:07 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F19D382EAA; Sun, 9 May 2021 00:01:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Jo6m1PWQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A93D082E88; Sun, 9 May 2021 00:01:11 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8DA0C82E97 for ; Sun, 9 May 2021 00:00:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd36.google.com with SMTP id t3so11286763iol.5 for ; Sat, 08 May 2021 15:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1XldzQ4edb1iPcoBZbVJNAXu6y0CdPx93HMtKdiZuGw=; b=Jo6m1PWQFHF5acTQIivBDTBrFE6WDOFgkcYd7QAMss2HEVvHjdRdhaIYLhwssbGbzA WW1mAqVpfgljf3N1rCDUmuYs8NUq1Cru30AakqxUzw7FbK0Y855MGpsqdMzsrIdew/XN JEQc8opjRVAW8ydNzryBzUSTg5O2+5XiYrnW8= 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:mime-version:content-transfer-encoding; bh=1XldzQ4edb1iPcoBZbVJNAXu6y0CdPx93HMtKdiZuGw=; b=emCy3o60p06fiBt3WAnHxQjVi5s9+ooKULzn0oFaVaoNf6zM4AZtlKSIYhng+G5eed 7iKpt2W1sTK+3YPZDvE+Mx/y1NJb9zmJkDUVnAVsYQ3qm694Gjkle4CiFhI+GzwIn/L/ GCRlZhvTUUrxXWbqdz5M5/+tFNdwvzYuW937/HQMrfSH8VNlCfU4mVeQQeKgdFCFxr5c uZzvKC6DV6GITEMmKea/GgCm0Zk0Cmg3l6DI4xyJvwep+KipYM5EpyuAmZvynSIHHW/7 RiYBXb8fKqmWfnij1PA9+Q6DtqFiAlSlpU3U5DhmaYrPuB7EBpiLEa5yaH1gWRWUNkjI 4Y4Q== X-Gm-Message-State: AOAM530U/lXrVwCVO4RN+icJuWR0jO6iOJaRpsFxEUIUtxHzunFLc/KY oGvfypIQV3Wi0DglSKp5nZfZI2h2H2e/nXpR X-Google-Smtp-Source: ABdhPJwPrGcYbXJH/P/Ta/eftjAaSENQ1jdl2imltDVDCSYwsUAYTeZ5BTVYu47fbxEu6UpgDZxaNg== X-Received: by 2002:a02:90cd:: with SMTP id c13mr14790225jag.18.1620511232086; Sat, 08 May 2021 15:00:32 -0700 (PDT) Received: from kiwi.bld.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id t7sm5195196ile.87.2021.05.08.15.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 May 2021 15:00:31 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Tom Rini , Simon Glass , Jean-Jacques Hiblot , Neil Armstrong , Patrick Delaunay , Pratyush Yadav Subject: [PATCH 06/17] reset: Avoid a warning in devm_reset_bulk_get_by_node() Date: Sat, 8 May 2021 16:00:10 -0600 Message-Id: <20210508220021.1778080-7-sjg@chromium.org> X-Mailer: git-send-email 2.31.1.607.g51e8a6a459-goog In-Reply-To: <20210508220021.1778080-1-sjg@chromium.org> References: <20210508220021.1778080-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean The devres_alloc() function is intended to avoid the need for freeing memory, although in practice it may not be enabled, thus leading to a true leak. Nevertheless this is intended. Add a comment to molify Coverity. Signed-off-by: Simon Glass Reported-by: Coverity (CID: 312952) --- drivers/reset/reset-uclass.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/reset/reset-uclass.c b/drivers/reset/reset-uclass.c index ac89eaf098a..668b8cb9420 100644 --- a/drivers/reset/reset-uclass.c +++ b/drivers/reset/reset-uclass.c @@ -323,6 +323,8 @@ struct reset_ctl_bulk *devm_reset_bulk_get_by_node(struct udevice *dev, bulk = devres_alloc(devm_reset_bulk_release, sizeof(struct reset_ctl_bulk), __GFP_ZERO); + + /* coverity[RESOURCE_LEAK] */ if (unlikely(!bulk)) return ERR_PTR(-ENOMEM);