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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88343C433EF for ; Thu, 11 Nov 2021 23:09:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 69F6861179 for ; Thu, 11 Nov 2021 23:09:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234355AbhKKXLw (ORCPT ); Thu, 11 Nov 2021 18:11:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:36630 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230308AbhKKXLr (ORCPT ); Thu, 11 Nov 2021 18:11:47 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id ADD7D6162E; Thu, 11 Nov 2021 23:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636672137; bh=T4wr7TRf+TISBf7dovqtq8hbh8HWQzrGfXkIAf5Qr2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eQ+1VvyNJI2c3bfWG4FXckAxETzL1lovyiVThD3+BQsIZotOTn/T8x7Z2NIBFXC2h NAzr9Xp+w/MRoDqWNLOAVZSgNQZe6nPxXlJwmkddfRL2QPewwN4skE1G4Bo11s0OnS 8d/JZ3wZI8AH7sS/A0S0JJSsQ8A3ZplN6+NpdQSiIcT1PyEr3QRKomQcIyvjieQgDI lffSJ43VLqDmOvpXSJR8/kUVJHjUfdBO22rSkhdgHP5IP4iMnVaPB/xx8/T71oPkjg iDorgYaZqQj/XFDLvQZCZDCveQaAJfvOQEMg8YP364YzKOxwUePKLYjd71oxNgEK0a kffjd/eywQ73w== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mlJBe-000I7E-4E; Thu, 11 Nov 2021 23:08:54 +0000 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Deepak R Varma , Ding Xiang , Greg Kroah-Hartman , Mauro Carvalho Chehab , Nathan Chancellor , Nick Desaulniers , Robert Foss , Sakari Ailus , Yang Li , Zheng Yongjun , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, llvm@lists.linux.dev Subject: [PATCH 3/3] media: atomisp: handle errors at sh_css_create_isp_params() Date: Thu, 11 Nov 2021 23:08:53 +0000 Message-Id: X-Mailer: git-send-email 2.33.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The succ var tracks memory allocation erros on this function. Fix it, in order to stop this W=1 Werror in clang: drivers/staging/media/atomisp/pci/sh_css_params.c:2430:7: error: variable 'succ' set but not used [-Werror,-Wunused-but-set-variable] bool succ = true; ^ Signed-off-by: Mauro Carvalho Chehab --- To mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH 0/3] at: https://lore.kernel.org/all/cover.1636672052.git.mchehab+huawei@kernel.org/ drivers/staging/media/atomisp/pci/sh_css_params.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c index dbd3bfe3d343..3cc5b82a8a31 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_params.c +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c @@ -2473,6 +2473,10 @@ sh_css_create_isp_params(struct ia_css_stream *stream, succ &= (ddr_ptrs->macc_tbl != mmgr_NULL); *isp_params_out = params; + + if (!succ) + return -ENOMEM; + return err; } -- 2.33.1