From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934742AbdGTLn0 (ORCPT ); Thu, 20 Jul 2017 07:43:26 -0400 Received: from mga02.intel.com ([134.134.136.20]:1438 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933844AbdGTLnZ (ORCPT ); Thu, 20 Jul 2017 07:43:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,384,1496127600"; d="scan'208";a="113479991" Subject: Re: [PATCH] xhci: fix memleak in xhci_run() To: shuwang@redhat.com, mathias.nyman@intel.com, gregkh@linuxfoundation.org References: <1500529238-12008-1-git-send-email-shuwang@redhat.com> Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, chuhu@redhat.com, liwang@redhat.com From: Mathias Nyman Message-ID: <59709818.9040109@linux.intel.com> Date: Thu, 20 Jul 2017 14:46:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <1500529238-12008-1-git-send-email-shuwang@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20.07.2017 08:40, shuwang@redhat.com wrote: > From: Shu Wang > > Found this issue by kmemleak. > xhci_run() did not check return val and free command for > xhci_queue_vendor_command() > > unreferenced object 0xffff88011c0be500 (size 64): > comm "kworker/0:1", pid 58, jiffies 4294670908 (age 50.420s) > hex dump (first 32 bytes): > backtrace: > [] kmemleak_alloc+0x4a/0xa0 > [] kmem_cache_alloc_trace+0xca/0x1d0 > [] xhci_alloc_command+0x44/0x130 > [] xhci_run+0x4cc/0x630 > [] usb_add_hcd+0x3bb/0x950 > [] usb_hcd_pci_probe+0x188/0x500 > [] xhci_pci_probe+0x2c/0x220 > [] local_pci_probe+0x45/0xa0 > [] work_for_cpu_fn+0x14/0x20 > [] process_one_work+0x149/0x360 > [] worker_thread+0x1d8/0x3c0 > [] kthread+0x109/0x140 > [] ret_from_fork+0x25/0x30 > [] 0xffffffffffffffff > > Signed-off-by: Shu Wang Thanks, adding -Mathias