From patchwork Thu Apr 11 21:17:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13626562 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 01D15C001CC for ; Thu, 11 Apr 2024 21:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FPenCDvWTyprs3ZNiz8As1nzyN4oImyhmTO58IYMq3E=; b=G+jFusx8mDY2Db 9SLv0QqgQawpC7TlldCgfhMcw6gIarGQU9BpYab7f03pOgCX7opKLO7TXC4VhdEPe6eLI5sKnT6+H 73bjLn5TTFlgSimEsuFNAe/L9RMUIPq771jvZlMtn96jYSi7szOUj2V99fW61KsqXWsN9MN9RtupK 25ave79ak6RvBY9h/fpSMTMMyQE631Bf+61rY+YR9wLZL13ycgzrk+vmmGS7uZBhei+MEigU0IcbN nOhGoiSvG+YKUV7wpZTpqm+SYxpzYtY3UAmzzmlTfU+a6l+nmjtIp4aiIF8WZVTcl+7lr+kYERktl DyqTQOnpybzT804tk45A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rv1oO-0000000E9w4-18ne; Thu, 11 Apr 2024 21:18:24 +0000 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rv1nz-0000000E9gL-3aTT for linux-arm-kernel@lists.infradead.org; Thu, 11 Apr 2024 21:18:03 +0000 Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-4347bcc2b47so914041cf.3 for ; Thu, 11 Apr 2024 14:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1712870277; x=1713475077; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TL6JnALE0FuyaUB3vxEn5mmMwRa1J5olT0hONBuxBN8=; b=Y4mYMFD5s/mlwl9CuW4ei0gide/+oMJyBh6s1zfymhwH0IQTsC6EsEN5rs6sTOlmBH XHcEdihK7DJ7rtlQCOaA6i4mAR/e34DRxPvIfo+kM4Zn8H3WHqTAqCiu9Cgtj5L0exyI KtFn8PkWknc8zmeL1Ak0Vpr9KJLSylWdNM/pg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712870277; x=1713475077; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TL6JnALE0FuyaUB3vxEn5mmMwRa1J5olT0hONBuxBN8=; b=YHXwGrIitiMrfYG0Ti7Y65jEYeYzFbQlwTl/Z23gvNg1TudWZM08Of1/LIDmxI4XxG mw8JPd3dzJfemk8RdjOybbgttwZGnaJmbAa7q6mREg7myQOS0dqu/RXRfZue9A/LgCoI 8kPQ3Vgbn7Tj4XyVX/kTqV3yAxdhpBAuLOJcT40HA4OIMXx3Sb0FuBHKp8GyXuqNWKr3 izLlD40ytSLo2h4M2IDdcEObsV9WqXApQWBn2DtcSCeaSQCxqovJgxMst2Yjs7muJmDp NgcjZBvq8SvL3/4V2X08nShdq8mpysfyTImXawOq4RyGUQ0EuOY/AnRsK56ZWhtbNqz8 vpAQ== X-Forwarded-Encrypted: i=1; AJvYcCUwTdy6BH3iUvfl4a2XcuaMy80fUVErCInBpYixR2F6B7/QAGlgU6ZuvMOq/vlNpbf4eV8xZNbLaFXG4gbZXkZWSA2NNE4IOoqJbu6tuRbz8NEksUw= X-Gm-Message-State: AOJu0YwHRJ94dJASwF9UoZ0VP2JQvOi/nN5LLHJSbDfbmZH1pvKVIcNE y+R+DE3TuPUKoJ23EMgMHQjyKmnzcUpGoy8z5L32r4ZfEaKY5yOL24xpc10CuA== X-Google-Smtp-Source: AGHT+IE1U/PUZQGaG+rxwc5mHpekiX8Y0J1WJQ10omBwhTFJ78n8RVlNr6NTsPRSnF/PRA/dbuDuOg== X-Received: by 2002:a05:622a:1897:b0:436:89bf:5706 with SMTP id v23-20020a05622a189700b0043689bf5706mr270247qtc.17.1712870277703; Thu, 11 Apr 2024 14:17:57 -0700 (PDT) Received: from denia.c.googlers.com (200.234.86.34.bc.googleusercontent.com. [34.86.234.200]) by smtp.gmail.com with ESMTPSA id k20-20020ac84794000000b00434d7c4f9fasm1373362qtq.8.2024.04.11.14.17.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 14:17:56 -0700 (PDT) From: Ricardo Ribalda Date: Thu, 11 Apr 2024 21:17:53 +0000 Subject: [PATCH 4/7] media: c8sectpfe: Refactor load_c8sectpfe_fw MIME-Version: 1.0 Message-Id: <20240411-fix-smatch-v1-4-045f92467937@chromium.org> References: <20240411-fix-smatch-v1-0-045f92467937@chromium.org> In-Reply-To: <20240411-fix-smatch-v1-0-045f92467937@chromium.org> To: Bluecherry Maintainers , Anton Sviridenko , Andrey Utkin , Ismael Luceno , Mauro Carvalho Chehab , Patrice Chotard Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240411_141800_093616_6817D89A X-CRM114-Status: GOOD ( 12.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org release_firmware() in the same function that it was requested. It is more clear and makes smatch happy. drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c:1146 load_c8sectpfe_fw() warn: 'fw' from request_firmware() not released on lines: 1125,1132. Signed-off-by: Ricardo Ribalda --- drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c index e4cf27b5a0727..ce0fd6ace8032 100644 --- a/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c +++ b/drivers/media/platform/st/sti/c8sectpfe/c8sectpfe-core.c @@ -1097,7 +1097,6 @@ static int load_slim_core_fw(const struct firmware *fw, struct c8sectpfei *fei) } } - release_firmware(fw); return err; } @@ -1121,6 +1120,7 @@ static int load_c8sectpfe_fw(struct c8sectpfei *fei) } err = load_slim_core_fw(fw, fei); + release_firmware(fw); if (err) { dev_err(fei->dev, "load_slim_core_fw failed err=(%d)\n", err); return err;