From patchwork Sat Jan 4 20:08:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 3434391 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D053A9F399 for ; Sat, 4 Jan 2014 20:09:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 251F32015D for ; Sat, 4 Jan 2014 20:09:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4179C2015E for ; Sat, 4 Jan 2014 20:09:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753892AbaADUIX (ORCPT ); Sat, 4 Jan 2014 15:08:23 -0500 Received: from mail.ispras.ru ([83.149.199.45]:37098 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752977AbaADUIW (ORCPT ); Sat, 4 Jan 2014 15:08:22 -0500 Received: from localhost.localdomain (ppp85-141-246-175.pppoe.mtu-net.ru [85.141.246.175]) by mail.ispras.ru (Postfix) with ESMTPSA id E4E67540151; Sun, 5 Jan 2014 00:08:19 +0400 (MSK) From: Alexey Khoroshilov To: Thierry Escande , Samuel Ortiz Cc: Alexey Khoroshilov , Lauro Ramos Venancio , Aloisio Almeida Jr , linux-wireless@vger.kernel.org, linux-nfc@lists.01.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] NFC: port100: fix leak of usb_device Date: Sun, 5 Jan 2014 00:08:05 +0400 Message-Id: <1388866085-11007-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 1.8.3.2 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP port100_probe() calls usb_get_dev(), but there is no usb_put_dev() in port100_disconnect(). The patch adds one. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/nfc/port100.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nfc/port100.c b/drivers/nfc/port100.c index 8a0571eb2627..a8555f81cbba 100644 --- a/drivers/nfc/port100.c +++ b/drivers/nfc/port100.c @@ -1509,6 +1509,7 @@ static void port100_disconnect(struct usb_interface *interface) usb_free_urb(dev->in_urb); usb_free_urb(dev->out_urb); + usb_put_dev(dev->udev); kfree(dev->cmd);