Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3637424pxb; Mon, 24 Jan 2022 14:06:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPYt05dcFTHWDR3ZTo71HeqDZbnbhq3CC2P9PJxz5BSUJbFoemBZfHLiau1bjvxzWltimX X-Received: by 2002:a17:903:11cf:b0:149:a17a:361b with SMTP id q15-20020a17090311cf00b00149a17a361bmr16501455plh.146.1643062007750; Mon, 24 Jan 2022 14:06:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062007; cv=none; d=google.com; s=arc-20160816; b=sNVVdARyeqTjn0ysV8ykMJra3FiQ5Kat+2WOsnIcG3KMmveCiLdbr68NrFLQblimVg MItkih/mCq6LWcj5VNquk6iaHpNyUDEwITJm8DLIaIyelHeqyVyBBs7YCZojv2+uiYX2 GY4h5JpchtdMXwOOyAN/o2xsEVR7IJMnc0ZDpwaPoEZ1D7Oov2L1HvrlVZD8KC5jO+1P ZGMqV2KV6EJREp/iooaOZOZro2Iqw/wuiaHklTI4n8Sc2jnj4zSct0f2+DCzQCwB30e5 w0uiLThGE//Z/PeaeMMERLGrV2sg6LiMb2GKTOlzlAFKZ+wFg19pEPhYXDp6nbYSdwBs doyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=VqHJp6xwuw+vCVM/DnDGKuCqABwNTwmm7axhki7FSWE=; b=YgVbTNd2X9kUgEVSBY3U2OmFJbILzr/tV86ljn3lLQlKsOgudAQER3QGU0tXDv9kqY TWala9VNLTLviKc2PWNC4niFe1ch2MsPPeApBCSl09Je1SiOIpgEcfcvQTCpYU5u/utc CKIBmu/YPiLqB39+F/LQ+zqnnberBKlEU4D/44pNTgGUg7bJ3jM0GY+MTd34lCOJDDsN bup1Vgzo2TncEkpN/k7+jEmUQ+WX6sZYX9zrxMwKNoxkfAOfJH8FoadnpNHGRYCQDvXl VBa595fgj6Si9LN2S6ZpsJmf3AUkzOuJKEquzjh8zr4uDjMxD8XkWiCIaoHJcdN3jtE1 9ELg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=si0XCzpE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bc15si7790440pgb.604.2022.01.24.14.06.35; Mon, 24 Jan 2022 14:06:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=si0XCzpE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379553AbiAXVyQ (ORCPT + 99 others); Mon, 24 Jan 2022 16:54:16 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:43842 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1450765AbiAXVVW (ORCPT ); Mon, 24 Jan 2022 16:21:22 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A932761490; Mon, 24 Jan 2022 21:21:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84D05C340E4; Mon, 24 Jan 2022 21:21:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059281; bh=Fhv3mi1Mm8uNIIYwqjQOhdSly4zsT0G1KS4gJQ8MreU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=si0XCzpEo79L/P4lnz9Dg402KNmBkSIfg6xHeqdLslPx7XX5q4VafbGRL5VdA/AZ0 3oaSBqkZku3eaJWpFsn69kcd3j0VC60ZQXjjujKNAK5Wj7vYRPQ/0ypJw0vg/JpP6W tRMLxGg4SIm0Ot84vCk3/CDtGyl6k1/JZx4EbIFg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.16 0564/1039] media: atomisp: handle errors at sh_css_create_isp_params() Date: Mon, 24 Jan 2022 19:39:13 +0100 Message-Id: <20220124184144.275112895@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mauro Carvalho Chehab [ Upstream commit 58043dbf6d1ae9deab4f5aa1e039c70112017682 ] 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; ^ Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/atomisp/pci/sh_css_params.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c index dbd3bfe3d343c..ccc0078795648 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_params.c +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c @@ -2431,7 +2431,7 @@ sh_css_create_isp_params(struct ia_css_stream *stream, unsigned int i; struct sh_css_ddr_address_map *ddr_ptrs; struct sh_css_ddr_address_map_size *ddr_ptrs_size; - int err = 0; + int err; size_t params_size; struct ia_css_isp_parameters *params = kvmalloc(sizeof(struct ia_css_isp_parameters), GFP_KERNEL); @@ -2473,7 +2473,11 @@ sh_css_create_isp_params(struct ia_css_stream *stream, succ &= (ddr_ptrs->macc_tbl != mmgr_NULL); *isp_params_out = params; - return err; + + if (!succ) + return -ENOMEM; + + return 0; } static bool -- 2.34.1