Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp22813pxv; Tue, 13 Jul 2021 20:29:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKbgKgkICvFx5rTGcp2b+BH9huoRQFEcZoZ77v+cgB1rOAuNFVCBmG/DoFyeTCK35Rdn86 X-Received: by 2002:a17:906:33d9:: with SMTP id w25mr9671234eja.91.1626233352841; Tue, 13 Jul 2021 20:29:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626233352; cv=none; d=google.com; s=arc-20160816; b=wDOk2+Kc3C3Xo3KhOpJFOLwkNcypabkKzVtOu+qQ+n7wCCadO7qVwh3nbP+1bmEIJ/ 8OhhyXzfNoARd5WrBONljYvDesu3I5YVnlxl7qfs294lpzOJnYb48A//0evyLN4L+gg1 Oh30A2C24NIuRBwxW8qTD40TIJqr3YuyPrmu3MUlZN4HRgTxAN2WY0a2JrSBzcOXsp6C oNEn3gNpH2PVt3yvKil+kFyU17BQa0E7CBzULi/LQHi6UXHY6Zm3VN9tISlzVt1PpuGZ gw9KqdPgLNYAcQ5R5PKSLPAcb6/Uv7+xb4SKUOkMESszKCU+SRgHFC/J9NtPHcMntYeH pohg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=VIzDtcMh9iUc8ZZOTxmi7csButnplyD6SuFzYXtDhe0=; b=TWT+d+rbkQTdt5fKQvfjs+qmWKEaTHsjRXW352N2yIjwEpgz7MuZWvM1yfTfktc+c7 BDAkkSbQTRUtN3BGg4AK11c5HN2cB7djPfnR/nRI5YyYXfckU4lxIKfE3zex2WBHaevW YylY4U1VGWqGGq9PNZ2sfuA3vSmEybfiPt0BYxipiGTSfLjQBjMW6G+AMfnNYnj4Wc2X ITz/lKc2xNRAZN5XCrafw32XKAEFnh0a7ZwGq98uWPr1X5/oGp8zhE8ay6re0Hx6ZHsP ygiCyHrTL6nipm29Dm3dFllwSyaNCFaV3K/PBoXU7iMWbkK4qQ4qSKaxIS/AX/vhIMou 658A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DYOrZlLE; 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 b94si1082830edf.23.2021.07.13.20.28.50; Tue, 13 Jul 2021 20:29:12 -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=DYOrZlLE; 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 S237874AbhGND0r (ORCPT + 99 others); Tue, 13 Jul 2021 23:26:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237725AbhGND0q (ORCPT ); Tue, 13 Jul 2021 23:26:46 -0400 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2B11C0613DD; Tue, 13 Jul 2021 20:23:54 -0700 (PDT) Received: by mail-pf1-x434.google.com with SMTP id j9so774171pfc.5; Tue, 13 Jul 2021 20:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VIzDtcMh9iUc8ZZOTxmi7csButnplyD6SuFzYXtDhe0=; b=DYOrZlLEegG0jNCY6d+1VfRC9uPdBH5MIQ2yTEfwRK3YDWP8VHyijGGtI4q6lxZEZp nFzFT+MsVZERIqdld4c0ho11fW6RpYdEcLvwMx2SWx26+iYomXrq423UMdKCryaPQPH/ YFag54LU5JYzeJveaBTonTSQm5EZ6AGsj2sqszr7GET31rQFjqnG3CCuy6bNKyXgSWUm YufL9UgjOTHSVZRlcmmR94CW5iKHiutb2/iafbYnz9/iy/EhxaQsS5WVMpV9p2sRqmVo k8fO0r6b7X3+SA1yvDxU4Ie84qVsd2pCpbUAnoMZTN7x1uBoc230B1rDO0alUR16O8Nb P8ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VIzDtcMh9iUc8ZZOTxmi7csButnplyD6SuFzYXtDhe0=; b=fxxeEjiJw4e3ucfsbOFq2qvVAR/IRHdkK2+UznJnIlqWkO+SbtSbo66gWRm31/CUhn elRQPs+m1rBTsW0yuKDvs7rZiSP8wu9nLNbJipwYJrpmtojGtj5VA8jmKvthfU6JcP91 otgYVDLe6OFZz7XEgkcaEsExXu4lY7O4qmqlSTibb2RWuugbqbixY5/iNsloeahhoK5/ Nw081f7pvDUoong57z7fLqGZSXJe5ffrw9zILm9tKuIM1L8V+jzFQ7/Gd2cRIXfeGmxJ BFPw1Cxtx4rIQ0hkgFZjrIlEKSXP59PuDKnFUXdu5f14wWBzi8P6/Jvk8x8hYqXw8vA9 QDAg== X-Gm-Message-State: AOAM533sDjOdKN2dtDNJUb+aHCqSOJCzHL+SLZa05KZjt+W2QwAs+fLu puX0D20RClw2rIUawNrNEFc= X-Received: by 2002:a63:3186:: with SMTP id x128mr7210797pgx.379.1626233034514; Tue, 13 Jul 2021 20:23:54 -0700 (PDT) Received: from localhost.localdomain ([154.16.166.218]) by smtp.gmail.com with ESMTPSA id z23sm4067181pjh.37.2021.07.13.20.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 20:23:54 -0700 (PDT) From: Dongliang Mu To: Mauro Carvalho Chehab , Dongliang Mu Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: usb: fix memory leak in stk_camera_probe Date: Wed, 14 Jul 2021 11:23:28 +0800 Message-Id: <20210714032340.504836-1-mudongliangabcd@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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