Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp270856pxb; Thu, 2 Sep 2021 03:56:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKG3YhHc0AdMCIq8M58HAqqyNLyQnVa0wq+7p860Tp7X4KQ7WE3W1OP2IGnZkLaZ48jlkP X-Received: by 2002:a05:6e02:1bab:: with SMTP id n11mr1936761ili.85.1630580178158; Thu, 02 Sep 2021 03:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630580178; cv=none; d=google.com; s=arc-20160816; b=FlTYwBR07FFmRNPs6sdYbrSbfCqm96AGIsQQ+FEnbsIsZGYKjiaC997No/9IBYHspW 32Xzbzm0Y5K3hZLokoLaLvvcuqz6kc/SVlH9TQCm4CguLH8pkRJV4ByDAhwbXLbT1111 GD8O/be4gBmOC0H5kwfeyUJeilbSJpZSMKtKnpKTCFj7EClhCv6S4cj0eWivFArY3hgi IBZfuQwOkkyXGyGelQ3pRxePaiuXOHr39HysMljMxnbtpFR/SeE2WtQ4nD7aVSQ7WnVf djCL9AL5viq4RFNujq0Wun/vJUP5fXs5PvUc5UzDSzZlXHH3nVfNFEYTwUdIW3CRRBVG Gfaw== 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=z8S8PBTuuy6W8YvwKgx9nMDnBhYR8E+ca6ZFT8GLcmg=; b=FhW0HX/TQwa23ZNjM9GNclt+pQvIOWLTaNOCtBKE+seYZzjDe0mgNXD9Os0v0jMsgH VTG7dScFAdvlSWYdlpQ/wKkAfuhl/5HNhai9YINubcXtkbtPrzXcbS4y2qRsvg6i6Jam GnIwXmWXQ49m9yfCRFy3mbbCvpt80imQGg6uUnpsqmwkHK8KW2capdxo3xNyKYzBNu1Y PuuQkGVSyk4HZJcoPd0BnrT/PwHpjtQHUvYGpLxtiIdZVXLfBWDX0n8G/Bueb13OTHtS yRcD+S04GD+2GborTAb+duhG843AXF7veDx01r9S6lQQBgd7u75cbs+q1ufd4QuhHTTa MRpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s2 header.b=SH0liSzm; 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=xs4all.nl Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f18si1505050iox.32.2021.09.02.03.56.06; Thu, 02 Sep 2021 03:56:18 -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=SH0liSzm; 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=xs4all.nl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237667AbhIBKum (ORCPT + 99 others); Thu, 2 Sep 2021 06:50:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236263AbhIBKuj (ORCPT ); Thu, 2 Sep 2021 06:50:39 -0400 Received: from lb2-smtp-cloud9.xs4all.net (lb2-smtp-cloud9.xs4all.net [IPv6:2001:888:0:108::2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFA7BC061575; Thu, 2 Sep 2021 03:49:40 -0700 (PDT) Received: from cust-b5b5937f ([IPv6:fc0c:c16d:66b8:757f:c639:739b:9d66:799d]) by smtp-cloud9.xs4all.net with ESMTPA id LkHpmiwTclQKhLkHqmKOn7; Thu, 02 Sep 2021 12:49:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s2; t=1630579778; bh=z8S8PBTuuy6W8YvwKgx9nMDnBhYR8E+ca6ZFT8GLcmg=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From: Subject; b=SH0liSzmKgUoL0hI9UUZqzASA/gjwWlwQooMG9aktGrU1uGMgl84kJDu1NAguBx4V E9Eqv+9kC3J+R752P4lryn3ehBdGF4b3iJZb3uNRKpQbzvs9bG1MvnReYNPc//pwO6 5yI2iVZiwECDthkWxzdvnUZ37YUIOq86Arw7KwZo7WSc6DlWeQiEbk88gKYOfCqx6N gt5yQUfgnt/Z5Gz24FoIk8NWvWZif9R8id5qs+Q/PzJZkC2S6epM8ftzmOAfMR9pcA 93hraVwjiNjALm9m8IZS/NTHgMB0PUgkZHTr6g/aaj23VILwgkAbi7A+XKeXitIUEa uP9Yvei7/Iv/A== Subject: Re: [PATCH] media: usb: fix memory leak in stk_camera_probe To: Dongliang Mu , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel , Dan Carpenter , Greg KH References: <20210714032340.504836-1-mudongliangabcd@gmail.com> From: Hans Verkuil Message-ID: <911af8f1-d654-b4e1-1aac-c8a7ff94f6da@xs4all.nl> Date: Thu, 2 Sep 2021 12:49:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfMtG5773DVqMm00i2M9TjNm6lyyWSRkJZUlCS9i7Xgy8HAYiw1GYfZx9ltiiX9UpndCkRJZpsATVre9Rj9KHnQ+xJqm2KSm6t8edndVXEQxjhe06pbaV c5jNiYaiumt4ot483fjLZoxsDyrRbopSSalT8TY+0pWubTLpfWSAgKTGwqSM5/ccgmuiRFHuTrNRucYHkVTfVh5F5TNYquh0fuyIDhGTQdO5DEY+1TPhsKiJ HS4HP4/i7kjRiwaLlGX+ke4xgaLX65C6aPaRynUQkzA/3g3dCf0jNQbc+B0M716KKhFIGX+2pb+zM1STp6yrs7WcQiXvZznnT4K55USyyXl9BsEEjeHVEEj1 6hBJnR7sOn6sLQTuUMPV8oGVrPgj81+zckrVq4JLc/QxS99HVLhYdWxZe2s311N753y9WcWdjr3AhZEz1kSjnXFwf3MxUarvMPPNF3ICg/l77H19iRMQ8edy tEjWIISdJBFXd2jJ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dongliang, On 02/09/2021 12:23, Dongliang Mu wrote: > On Fri, Jul 23, 2021 at 6:11 PM Dongliang Mu wrote: >> >> On Wed, Jul 14, 2021 at 11:23 AM Dongliang Mu wrote: >>> >>> stk_camera_probe mistakenly execute usb_get_intf and increase the >>> refcount of interface->dev. >>> >>> Fix this by removing the execution of usb_get_intf. >> >> Any idea about this patch? > > +cc Dan Carpenter, gregkh > > There is no reply in this thread in one month. Can someone give some > feedback on this patch? I saw that it was marked as Obsoleted in patchwork, but I might have confused this patch with similar, but not identical, patches for this driver. I've moved the state back to New. Comments follow below: > >> >>> >>> Reported-by: Dongliang Mu >>> Fixes: 0aa77f6c2954 ("[media] move the remaining USB drivers to drivers/media/usb") >>> Signed-off-by: Dongliang Mu >>> --- >>> drivers/media/usb/stkwebcam/stk-webcam.c | 1 - >>> 1 file changed, 1 deletion(-) >>> >>> diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c >>> index a45d464427c4..5bd8e85b9452 100644 >>> --- a/drivers/media/usb/stkwebcam/stk-webcam.c >>> +++ b/drivers/media/usb/stkwebcam/stk-webcam.c >>> @@ -1311,7 +1311,6 @@ static int stk_camera_probe(struct usb_interface *interface, >>> >>> dev->udev = udev; >>> dev->interface = interface; >>> - usb_get_intf(interface); Even though this increments the refcount (which might well be unnecessary), it is also decremented with usb_put_intf. So is there actually a bug here? And if this is changed, then I expect that both get_intf and put_intf should be removed, and not just the get. Regards, Hans >>> >>> if (hflip != -1) >>> dev->vsettings.hflip = hflip; >>> -- >>> 2.25.1 >>>