Return-path: Received: from mail-vb0-f43.google.com ([209.85.212.43]:55462 "EHLO mail-vb0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750875Ab3I1ERz (ORCPT ); Sat, 28 Sep 2013 00:17:55 -0400 MIME-Version: 1.0 In-Reply-To: <1380340311-4630-1-git-send-email-khoroshilov@ispras.ru> References: <1380340311-4630-1-git-send-email-khoroshilov@ispras.ru> Date: Sat, 28 Sep 2013 01:17:54 -0300 Message-ID: (sfid-20130928_061827_242146_29658010) Subject: Re: [PATCH] carl9170: fix leaks at failure path in carl9170_usb_probe() From: Fabio Estevam To: Alexey Khoroshilov Cc: Christian Lamparter , "John W. Linville" , linux-wireless@vger.kernel.org, "netdev@vger.kernel.org" , linux-kernel , ldv-project@linuxtesting.org Content-Type: text/plain; charset=UTF-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Sat, Sep 28, 2013 at 12:51 AM, Alexey Khoroshilov wrote: > - return request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME, > + err = request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME, > &ar->udev->dev, GFP_KERNEL, ar, carl9170_usb_firmware_step2); > + if (err) { > + usb_put_dev(udev); > + usb_put_dev(udev); You are doing the same free twice. I guess you meant to also free: usb_put_dev(ar->udev)