Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3346198pxv; Sun, 4 Jul 2021 16:10:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrnlyLUxhyag0xLRH13ATlG5kdh7WRn+CFwd4dXZIentT8RExfxUTQLRSK2khV8j49JWKd X-Received: by 2002:a05:6402:1e8c:: with SMTP id f12mr12569115edf.169.1625440235520; Sun, 04 Jul 2021 16:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625440235; cv=none; d=google.com; s=arc-20160816; b=rAla5dG283qViCd1HWlJZ+MqVbY4MnVAyjZpjJ0aMrrzBUqAW+8N1vtLXseajzL1fi TaUNgyPUJwvpA8DMYQrJ5zRhZ8uPkPCrew7KRVKYPBtUMn0n2LBLcWqnNQ8rH+7eFid+ WaDEgO+5ph69eIIxoySvhDEv6BZFBvejHQsj9jSNDavVZ3Nqjnk/9FjCr2zvsEJCYsrw cb8K3RogPnJr/MuZlOOJBjw7h0p8QUkEjRlbuqzv2ti6PvZ1DD+cCQ6wfDKZI04NI0Qd rZdqB1TswyuoSb1mIIgbS0dXmzXmHdvoIP5+Zuuhv3v9qtVnhs7af/9pfoOZlP5SMwxH s2Dw== 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=/J5J6xus+HB80Mv/dkqOt6nd4sqjrQMBR4ks2Nq/d50=; b=pqZ3zMRdhrhJatX29Go8+4Odw1+7xMXkP9eFOM0sRaHOsFF0Ps+FIsXF5ucog9BGtI nxDA3reiTYQx4sH/iqmXgRy2YjL44mZDoPzRs4tAlJNw1L2gYF5voYQV42j17ApPq1iS XGE5VglRvikT57cBK5ipWsk9KvpKw5Kp50WgKTkUQVAsmWI3BeyNiltvlVptvjBt4xWT 7TEMjUP7RHtb1riPp2lU5ApSlgCDqSHpDOn4vjBC2PrUZrEltqUDfD5lf5T8F5ugYS+s 7n0v0++sSQkpMPRnYGzUFYH4ATIEHzxzPxQrvMCTdYXdAmTfoq32vYz4e0aAZ0UsQcjj 3XdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YYn1va7r; 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 my38si9502161ejc.602.2021.07.04.16.10.12; Sun, 04 Jul 2021 16:10:35 -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=YYn1va7r; 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 S231811AbhGDXLt (ORCPT + 99 others); Sun, 4 Jul 2021 19:11:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:49110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232327AbhGDXKK (ORCPT ); Sun, 4 Jul 2021 19:10:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B26C56144E; Sun, 4 Jul 2021 23:07:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625440054; bh=BlGq8KKuCkSpLMk5NR9JZxmkyEyOdfvm0EvyJwhVNFY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YYn1va7rHp+S2oNt4C47mYOLV+zVYExmkT6/3lpjGOTimYgy5zPKOhBDDC2sL4CNN ZpWGeGE5U5c462k/3fgfK0GT9e0ta0cAVd3kTWEkh+FGP0ArtI9zNWA7pEHQOE/zOv Z5WbFA6lAeHu8wqTJkInDq+YFo3H+yvCHTqAOI7Qoh8DPr7J+qVWDJq3JuViWjIUT6 iEA/6yU+zalgAcO5Hm0gUNjurhR9Y4dJfosoTdce/QD98sYp6UtH6Q8BW8Q/g/InqJ a56gyU3ajFVPMiKyGrMbGar/pw0TEC2TFHYjy4ry7QAu8h22MGb3MikOS02JQcEwRQ jnxI1wzZaWAqg== 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.12 58/80] media: siano: fix device register error path Date: Sun, 4 Jul 2021 19:05:54 -0400 Message-Id: <20210704230616.1489200-58-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210704230616.1489200-1-sashal@kernel.org> References: <20210704230616.1489200-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 ae17407e477a..7cc654bc52d3 100644 --- a/drivers/media/common/siano/smsdvb-main.c +++ b/drivers/media/common/siano/smsdvb-main.c @@ -1176,6 +1176,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