Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1226074pxv; Fri, 23 Jul 2021 03:14:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOxWnyzzfohfUheOSZc5M9dcOkxO2PLG+lc3613czauPXRT8ZjXEOp0JzaRS3S0iMrpVcI X-Received: by 2002:a17:906:616:: with SMTP id s22mr3910415ejb.210.1627035253604; Fri, 23 Jul 2021 03:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627035253; cv=none; d=google.com; s=arc-20160816; b=IFlgDRccq/wLsSOKvVCsi7HzmOH8Dceug/7b2qsN1svvq6xwa9tuZ3mMq3FvaGwkMm w+/BPpjKnlcYZ4Yb226vaolWUd/0FNnFNHyr1ugGs+pO1KuJRz3mT3rpk6LFouMQLuxt J3gDPnxt93Y/KTFRHtE1nLI6GMW3PaENM+bTnsbD/C9RqIi62YrTGvFIXXSM7ANECaoP yvH0ESQMv1pd54SQk9ZL0H/mAlo7cwu7c1IhSUTqdfSh/h8KyBF/i3DSYjy97C/F/BaK R+DsaAsaHQH9gQQHLp4q1l7Br5isFlejSNtmKDU01FMQG0rYYPawABS1aq6WfdZTylgx GMIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=lq6dxgIqN0xaQXANjs2LAfU4P3/YylmyKp58xBdTWlM=; b=ZotW4nS5URp64qupm99e+QyKE9v06nda8+MIiBZOADXBkpxhrjHaeqDzQ8aGPbiOV8 ubr8ojrgiSn7BqQxXfkJFDtGCzvOlqtfK8pqbp+9naXMNSYED7l+22BENpTvO4TkLVsR ZvacGLuW5ecBO4sQQZyUczWQNBRIKYuLNVO3w9Le1e9acPYcqFYbfflRrnIFMYqUQ530 zwFkblw/PrufXIE+sUhFDYEq+Lon+h93tfSppRIMqA+tcqrixjMEyHGNMntE3Z2vfLPr btK6Svb1retJpj0DLp2h7f7tcbKqDPaL1bqI1vEzEVVqzt6R17qN9LilY4T6pYphoV7l U0Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=op4xvQbJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s9si17617925ejx.346.2021.07.23.03.13.49; Fri, 23 Jul 2021 03:14:13 -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=@gmail.com header.s=20161025 header.b=op4xvQbJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbhGWJbb (ORCPT + 99 others); Fri, 23 Jul 2021 05:31:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbhGWJbb (ORCPT ); Fri, 23 Jul 2021 05:31:31 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6CB9C061575; Fri, 23 Jul 2021 03:12:03 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id z26so1140261edr.0; Fri, 23 Jul 2021 03:12:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lq6dxgIqN0xaQXANjs2LAfU4P3/YylmyKp58xBdTWlM=; b=op4xvQbJ03bPymE1+ptO+ymqU8x+zTfVlt4X87zKKci3oNuHr22EJBI3+ZyI6YjhO1 qitKiNdHuXKYsDqPYa6gU+zArHwnuJUI30Vj3sEhYHYicjEoyzqZ2xfBQmCyy6tOfan0 FLdRxnyYek5/VMT2KXSvLo/uGdb12qnqqMUKvKKduerWX4ToplE5/Z3nWMnHhzcucJSA EuA3iLe1Usf/N7qschGf117jTJLWfezejsVcIiI3KawXApWVZmKz+BXAp4kwfhKSRBg8 jR3BBsp82dhgJlL58DVAd/TstmxcGMZrG/Zwl3HZzYeuIiuYNMB1Uci2+580n2GdzhcW OK4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lq6dxgIqN0xaQXANjs2LAfU4P3/YylmyKp58xBdTWlM=; b=LwM2UzAPYySu+BBCpc+THi+UhhOD9GX52WprMvH5DZ2B8D/75zqNiMQ0fu0wtMb6s1 8T5XJMUQ4CyJbM+EtSI7Zub18PIDF1eUE5phkc+hrt/RuB5ttiNpsj1QNdKnn1NW35fI Tcdvxy7dE/htwKJeyfpC5/vrD3T+6Bz7gtUZqH49DLJIk6wY4i3t/kHQDKVmmotN7ckq b5PgAsDZ0FzTONPEaw14Db/j+I9RwLRZEt3aMle0YO++UpGJMEVWFT0DrM4M+WrramLS uvDGUECwv9tpLXxAKFQ0QpR2PW+6YCQ7KN84cHz4JwC8M3fV8wrgPfGW4rvDCg2AEB+A 90HA== X-Gm-Message-State: AOAM533fW22AAA2G6pz/Vnf152ltfALHDvNKyqLk1kpKHy6CRLQGwDoo GdX7Zv4ayLSMFFQTQYKbpLp5NVi1l16DmXpz8+k= X-Received: by 2002:a05:6402:1c10:: with SMTP id ck16mr4560349edb.339.1627035122444; Fri, 23 Jul 2021 03:12:02 -0700 (PDT) MIME-Version: 1.0 References: <20210714032340.504836-1-mudongliangabcd@gmail.com> In-Reply-To: <20210714032340.504836-1-mudongliangabcd@gmail.com> From: Dongliang Mu Date: Fri, 23 Jul 2021 18:11:36 +0800 Message-ID: Subject: Re: [PATCH] media: usb: fix memory leak in stk_camera_probe To: Mauro Carvalho Chehab , Dongliang Mu Cc: linux-media@vger.kernel.org, linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > 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); > > if (hflip != -1) > dev->vsettings.hflip = hflip; > -- > 2.25.1 >