Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753425AbaA0Gbj (ORCPT ); Mon, 27 Jan 2014 01:31:39 -0500 Received: from mail.ispras.ru ([83.149.199.45]:33335 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750895AbaA0Gbi (ORCPT ); Mon, 27 Jan 2014 01:31:38 -0500 Message-ID: <52E5FD48.7040208@ispras.ru> Date: Mon, 27 Jan 2014 10:31:36 +0400 From: Alexey Khoroshilov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Dmitry Torokhov CC: Greg Kroah-Hartman , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: Re: [PATCH] USB: input: gtco.c: fix usb_dev leak References: <1390087466-9898-1-git-send-email-khoroshilov@ispras.ru> <20140121195957.GB29615@core.coreip.homeip.net> In-Reply-To: <20140121195957.GB29615@core.coreip.homeip.net> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21.01.2014 23:59, Dmitry Torokhov wrote: > On Sun, Jan 19, 2014 at 03:24:26AM +0400, Alexey Khoroshilov wrote: >> There is usb_get_dev() in gtco_probe(), but there is no usb_put_dev() >> anywhere in the driver. >> >> The patch adds usb_get_dev() to failure handling code of gtco_probe() >> and to gtco_disconnect((). > Hmm, I think gtco should simply not use usb_get_dev() in the first > place. > > Thanks. Dear Dmitry, Could you please clarify why usb_get_dev() not needed here? We store reference to usb_dev in gtco structure, so we should refcount it. What is wrong in this reasoning? Thanks, Alexey -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/