From patchwork Fri Mar 21 22:20:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 3876591 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2597FBF540 for ; Fri, 21 Mar 2014 22:21:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A43C2025B for ; Fri, 21 Mar 2014 22:21:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9650F201C7 for ; Fri, 21 Mar 2014 22:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751876AbaCUWVA (ORCPT ); Fri, 21 Mar 2014 18:21:00 -0400 Received: from mail.ispras.ru ([83.149.199.45]:46641 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751823AbaCUWVA (ORCPT ); Fri, 21 Mar 2014 18:21:00 -0400 Received: from localhost.localdomain (ppp91-77-214-187.pppoe.mtu-net.ru [91.77.214.187]) by mail.ispras.ru (Postfix) with ESMTPSA id 262C0540157; Sat, 22 Mar 2014 02:20:58 +0400 (MSK) From: Alexey Khoroshilov To: Lauro Ramos Venancio , Aloisio Almeida Jr , Samuel Ortiz Cc: Alexey Khoroshilov , linux-wireless@vger.kernel.org, linux-nfc@lists.01.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] NFC: pn533: Fix device leak Date: Sat, 22 Mar 2014 02:20:50 +0400 Message-Id: <1395440450-21178-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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 pn533_probe() calls usb_get_dev(), but there is no usb_put_dev() in pn533_disconnect(). The patch adds one. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/nfc/pn533.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c index cf1a87bb74f8..fed19d5473bb 100644 --- a/drivers/nfc/pn533.c +++ b/drivers/nfc/pn533.c @@ -3301,6 +3301,7 @@ static void pn533_disconnect(struct usb_interface *interface) usb_free_urb(dev->in_urb); usb_free_urb(dev->out_urb); + usb_put_dev(dev->udev); kfree(dev); nfc_info(&interface->dev, "NXP PN533 NFC device disconnected\n");