Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp1129269pxy; Thu, 6 May 2021 00:45:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ0HLWqSCDMWMSABsf8WznwHH3ntbQvrSLZJhY5rO9Ay/JoP4liV7u9LLHfDGGtqxgUtbh X-Received: by 2002:a17:906:5a83:: with SMTP id l3mr3005348ejq.50.1620287116808; Thu, 06 May 2021 00:45:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620287116; cv=none; d=google.com; s=arc-20160816; b=qKYmlFrq3ns2OWoSGsBcoZrZk5b/Jv7p14GBg7nOYQ3uDC/KNiQZlmfQwVwCTqvFic 2g212T1PhB//OIVDiKBrDJ8CjnrvDlDlfRPolqALwu9C7HYHIm9+JDuT50myG4lVIZVc 8EqRrq2tJv7/9Tr2vpGsSKmuCVOCBLsyspDIjr66bc+5ZX19b/WBHg9qUaMcVGwoybtM RWY7i9DwhExJLpbqOeXUeDBx+VFoOUTXBlR7EePisW+5MHI7x2ahf1M3Pcqcv+WSX1fB deiAxdy9Vl0UMRzQ34MxZdXVozf0Di+B+6ZxEqpmXcByvyOApsT6b+GFJsiKPdiJZM4A 9LTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=unHdzur1Mkh9esYlD770TAZ6YmoFAcm5mK7Os/coVIw=; b=aHsvj0r8F5uwivaP1UxLOmVFIZILl5QEXeBrUqKgeRx/4jlokpkR1uamkwj+dL08ZU RHYEwjUfZia3IRlOnO+Y/Lt4CQhFI1a2I7DBMTKPmMjrbvgPK6V3NlXLLQ9MlyiWRJKx Oo+wQmugJ0eORbQfCQ3I06PHgL7lPOBTDqd5Gc2XaUEXV8mPR8uEPHfMXzEBNg0C13DS rjD4COsmCHqwaCckG/hk+x5RqOd0HeiLCHNkXyvioAEGMQVWrVvjvrqf8Q+VkN2lGFFS hD2AtIAXWGEDooUrkRynPCoEVyReiMY2vCiEb19EJYSl+I413a2r7GWryAKRPiZpCE26 7GSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s2 header.b=sMFoYJbX; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si894591edy.550.2021.05.06.00.44.52; Thu, 06 May 2021 00:45:16 -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=@xs4all.nl header.s=s2 header.b=sMFoYJbX; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233505AbhEFHog (ORCPT + 99 others); Thu, 6 May 2021 03:44:36 -0400 Received: from lb1-smtp-cloud9.xs4all.net ([194.109.24.22]:40531 "EHLO lb1-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233340AbhEFHoe (ORCPT ); Thu, 6 May 2021 03:44:34 -0400 Received: from cust-b5b5937f ([IPv6:fc0c:c16d:66b8:757f:c639:739b:9d66:799d]) by smtp-cloud9.xs4all.net with ESMTPA id eYfUlTIqRWztCeYfXlNV8B; Thu, 06 May 2021 09:43:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s2; t=1620287015; bh=unHdzur1Mkh9esYlD770TAZ6YmoFAcm5mK7Os/coVIw=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From: Subject; b=sMFoYJbXILvJnVOJ4VXd3xsSNTTYBc7Ccl/qKglRHZfzJCqFGC3mcPSmP3II+QZtc GTQfvXC9WTxr8tCFanOQxw92kqL0WQMDsitdOzvdDkYxMWhYmAg63e7/4HagXvkyt/ kDrYNpEQi5XLkMgb/6OdUdcLIACABExbcqsE9BrbZ94R+Jt91F6r2GpSyCDBaV+6TO pmvRj6jy5JksIzFHzjwSwSRc3CjiAvL6QdyFu21IPZaJNVwIgvwXrhksGzkBRaIoOq 4AZnbCYthXhzwJojLt4YFlrEwjDBeiMClaeo7nA8B316ITuObXOFffS0itTJw3EOxR TQ9LxEzmKrhGg== Subject: Re: [PATCH v2] media: em28xx: Fix possible memory leak of em28xx struct To: Shuah Khan , Igor Matheus Andrade Torrente , mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210504183249.6307-1-igormtorrente@gmail.com> <21f59c86-f1ae-5913-cde9-078fe4f6f752@linuxfoundation.org> From: Hans Verkuil Message-ID: Date: Thu, 6 May 2021 09:43:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <21f59c86-f1ae-5913-cde9-078fe4f6f752@linuxfoundation.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfLpAPFWbzxG1n5DD1kdMHLqnUyirtt8Hneq0LxPZ1+BryYPj/aDOYGkwJ8xNP9D7/TkB4QXqWNJbUffbjK9PwUhd4z+INi+SsBrD4kWcNWY39R15ShSE bjLMOY9igusoWvTFQic+dPBsKii6b00QVF1yxGbNV83Dl5Otuf+w+UPkAlTKLamUN3Dm7RTqXBuMgcj2j9M0iIQ0eqqdFb4k0Tew/A3qzdlD93zvAEV6aj4E fz8uCkqBAeVjAC73HBCPnqMNlurYQXVXrswn7QO3I3L7uoFrQUKz3aSLmRQsb03apMVB3gxgF6xyKXBxJNeQfMoNE5uQ5CWLtrRksGORkjgUeleDcSKnrI2C qANBB3Kv Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/05/2021 17:54, Shuah Khan wrote: > On 5/4/21 2:32 PM, Igor Matheus Andrade Torrente wrote: >> The em28xx struct kref isn't being decreased after an error in the >> em28xx_ir_init, leading to a possible memory leak. >> >> A kref_put and em28xx_shutdown_buttons is added to the error handler code. >> >> Signed-off-by: Igor Matheus Andrade Torrente >> --- > > Hi Igor, > > Please look at Hans's response and comments to your v1 patch. v4l core > addresses the lifetime issues now and this driver could be updated to > use them instead if fixing the problems in this driver's resource > lifetime mgmt code. Actually, this patch is fine (I think, still need to review it). This is related to the input part, not v4l2. Regards, Hans > > Please follow his review comments to address the issue based on his > suggestions. > > thanks, > -- Shuah >