Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3344764pxv; Sun, 4 Jul 2021 16:07:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/7FENQZtq3u7xGLjl7BnDAHvUa4y63+4ts8d/Phfm5sLYdZcgnuCVLV7aqM3K9Y1CQvIm X-Received: by 2002:a05:6e02:dd2:: with SMTP id l18mr8152047ilj.34.1625440072484; Sun, 04 Jul 2021 16:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625440072; cv=none; d=google.com; s=arc-20160816; b=l/QHU8GRQukfJZUAdmtE0UC4ukzTle9gtZiiqjYVx/qhASP2m3t8yqbCLsYMWuWNRO 9unRl+vGjX+LfDNsrfQ0v6SJHAh6QRjUb/HjFlNKOW+ciNzooKiaZYZcAPPh1z5kpQ4P 5o1Cq0A/O5BXBc1j1hm7x5Hn8sdpOXHmOLqKzdt8LQDnQnZftkkNq8IihdKbDbWyPxHh ZVmhVYQ6WqtXkkuvYTLxB5jnVwE0/aip8e7bE+EGtJZFZz2UMyUMzlDT5FEMqPyWpGg9 1AcTnXFsro4cJ9cD4LW5Zoh3D/MMIhVI/Mn2TsTnHfMc3aFPm6+TdUx946nDv7ShNZdd eLPQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BT20j/swwMjVYKAgiSEZ+5vzoIdMepAtRN1ivlRqRyk=; b=npUPOK8t41L+Rvt8ODPun++iVtCxqWeo7wTJoYTrgpG21X6kYs/o2zPgItpH6wCoU3 MDAfpwIWq3OtkrxA+Qe4+m68/3r6mz+xr/ApTjoU4JCSlCbDfWbHne3w0NtLvB4Tnpmu Gx3C7WQxRTN3toz5+DIwoSezyWAik1A2/nNpU2D0MpSAOfE8hYPgBzC1k9FUGv+LYnUe qDT7lyDS+47bjp+fMJwB0W2rYZVHbZbcg2H2kZpsevuBAHsuiNP0xlbn+SWJmNTBY4St GVQ/5hszuRIXn8G3IoFm7tr4ouH+h0T/rNetZy5qbZP31wKI5r2CbRC8xQjQYfuctZLH S1vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SsPKZcjE; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u8si14008126ill.90.2021.07.04.16.07.40; Sun, 04 Jul 2021 16:07:52 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=SsPKZcjE; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231828AbhGDXJO (ORCPT + 99 others); Sun, 4 Jul 2021 19:09:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:47318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230353AbhGDXIT (ORCPT ); Sun, 4 Jul 2021 19:08:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 674E4613F1; Sun, 4 Jul 2021 23:05:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625439943; bh=zlRAvS0RDgjJ2LkGWY/QXBDscxE3qswqEy1ILegPTAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SsPKZcjEhuNdjZRe5TmLWDG16qoX/l/HCEtJcXu9hJFQsyMWfeAddFbTmCnbm74jq wu9sE2KbprLFZyFyKOhw0t4eYbRzXhpZhtFD0lJJEgU6WcQ2iGAiwCcAUTul1vU8lr SHNk6OgEWXW6lSiD64DU76+EAmKUBaWQpjOlkt7ERwvw6OGiOaO0S8CCjS61TCpwkE bpplqEJx5uexf4Wy/Hv1viaerD1ezHLxz5d3gDOslXNc63QlXra+LXOPxrxUsthNmC n5/jafbCet4swPIs/dqG20+Qkuns5PIy6N0qIRZC4NxKvq/aiEhZo7/g0t43bFruZ0 dK7XClppotSWA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mauro Carvalho Chehab , Sasha Levin , linux-media@vger.kernel.org Subject: [PATCH AUTOSEL 5.13 61/85] media: siano: fix device register error path Date: Sun, 4 Jul 2021 19:03:56 -0400 Message-Id: <20210704230420.1488358-61-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210704230420.1488358-1-sashal@kernel.org> References: <20210704230420.1488358-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mauro Carvalho Chehab [ Upstream commit 5368b1ee2939961a16e74972b69088433fc52195 ] As reported by smatch: drivers/media/common/siano/smsdvb-main.c:1231 smsdvb_hotplug() warn: '&client->entry' not removed from list If an error occur at the end of the registration logic, it won't drop the device from the list. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/common/siano/smsdvb-main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c index cd5bafe9a3ac..7e4100263381 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -1212,6 +1212,10 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev, return 0; media_graph_error: + mutex_lock(&g_smsdvb_clientslock); + list_del(&client->entry); + mutex_unlock(&g_smsdvb_clientslock); + smsdvb_debugfs_release(client); client_error: -- 2.30.2