Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp774635pxb; Tue, 5 Apr 2022 22:47:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGftpSOuDkIbP7mB1oR/6iWECkqfvMfPL9Jrf2wLMZSvFSwVNKwSfs1eVRPBJ483eDVWbl X-Received: by 2002:a65:6e87:0:b0:380:a1ef:a9be with SMTP id bm7-20020a656e87000000b00380a1efa9bemr5736456pgb.284.1649224057523; Tue, 05 Apr 2022 22:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649224057; cv=none; d=google.com; s=arc-20160816; b=DOajbG/CMfH4+GxtuE5oPmMB7qmgPh4gvhcbyMIY2JKlsqTwyDG60aklsncrykfP/P aKK+YGODVseXSYoqv4FWnRuA1NrJD1abcdMqM8WsQ4dV06EDqtpc9+ZqeGaj5Kkwxhq1 1lCFcGQ5MOK8f8IeRA49awGOlORZhhoMAmt6h1OxkupHijAeI/hcbIHYCIu4Xsjq7Mbc To5GfTSgRmXaWJ5uSYGZ0SEmJaDVjKs/46s4AkeEJYUWUuO0ClJf4DORkruFhP3drGqq OlTMnhWktB7jZAgFrgr5laIQRNghpGgN2a+QvdV0mjbYpg2uZP9mTaRby5USMYK78GxQ lQiA== 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=QVxyswadvl0vhe8bcZF/8EQ5hG5W+AzxcB+SevfyuDE=; b=izCp5d5RCJmBf6X9+hHzP/qkepn/ItRJMI/K3fQRzvtR/VUhJHBJ+l0tEv3f7KoTBE CfwJgF2pCUKgzKjR2owmoh82MR3iweAFFnEXw1iV+BRKFOfu4DOem+79D1r1J1QFsAcy os/jQWxMiWQHTBXq15KoN5bWqVGmaLABl/yQUXT1OSB+In0zQ2MG8lBVbMsW4Ztxiz8K V0QhZ1LiYii4q2P1h3MeD+7pLZq+V2OU8D3JKyKt6u2ixbNAARHEM2KreRVROAYfxs/S Y9ioLMKuMV3sh18SOhII0UPUpdlci+PncayCXaYuwMbe2AXgLwND8axLNmuLDb5bS4DA yycg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LuSR2FeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p12-20020a1709028a8c00b001568acea014si10515976plo.261.2022.04.05.22.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 22:47:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LuSR2FeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5166448D2D3; Tue, 5 Apr 2022 22:12:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379956AbiDEUkn (ORCPT + 99 others); Tue, 5 Apr 2022 16:40:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348703AbiDEJs0 (ORCPT ); Tue, 5 Apr 2022 05:48:26 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C735A39141; Tue, 5 Apr 2022 02:34:28 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id D76DFB81C6F; Tue, 5 Apr 2022 09:34:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 352F6C385A3; Tue, 5 Apr 2022 09:34:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649151265; bh=kTf509aGxUC2L+Qqne7LOHBXyNCvMcSwY5mKQwAKabs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LuSR2FeT1dCKZohKSNiS98pagNhZA6vxaK0/mf61OduRGhR4jrH5800Lf0B8iGoHX bzb3SKKQzZ46lXOPJtRuqf6FdPqn1l+jFZPf3dzSmDr7RvoXCtGSUcV8u60MnDXcig NYwjDTILyiJ+/LArSsHQ6UY91MXfyreilol+waaU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jakob Koschel , Hans Verkuil , Sasha Levin Subject: [PATCH 5.15 353/913] media: saa7134: fix incorrect use to determine if list is empty Date: Tue, 5 Apr 2022 09:23:35 +0200 Message-Id: <20220405070350.427357768@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070339.801210740@linuxfoundation.org> References: <20220405070339.801210740@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jakob Koschel [ Upstream commit 9f1f4b642451d35667a4dc6a9c0a89d954b530a3 ] 'dev' will *always* be set by list_for_each_entry(). It is incorrect to assume that the iterator value will be NULL if the list is empty. Instead of checking the pointer it should be checked if the list is empty. Fixes: 79dd0c69f05f ("V4L: 925: saa7134 alsa is now a standalone module") Signed-off-by: Jakob Koschel Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/pci/saa7134/saa7134-alsa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c index fb24d2ed3621..d3cde05a6eba 100644 --- a/drivers/media/pci/saa7134/saa7134-alsa.c +++ b/drivers/media/pci/saa7134/saa7134-alsa.c @@ -1214,7 +1214,7 @@ static int alsa_device_exit(struct saa7134_dev *dev) static int saa7134_alsa_init(void) { - struct saa7134_dev *dev = NULL; + struct saa7134_dev *dev; saa7134_dmasound_init = alsa_device_init; saa7134_dmasound_exit = alsa_device_exit; @@ -1229,7 +1229,7 @@ static int saa7134_alsa_init(void) alsa_device_init(dev); } - if (dev == NULL) + if (list_empty(&saa7134_devlist)) pr_info("saa7134 ALSA: no saa7134 cards found\n"); return 0; -- 2.34.1