Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932224AbcKUORp (ORCPT ); Mon, 21 Nov 2016 09:17:45 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:8278 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754717AbcKUORl (ORCPT ); Mon, 21 Nov 2016 09:17:41 -0500 Subject: Re: [PATCH] scsi: hisi_sas: Add a missing call to kfree To: Quentin Lambert , "James E.J. Bottomley" , "Martin K. Petersen" , , , References: <20161119174259.20344-1-lambert.quentin@gmail.com> <0edd4edf-f7c8-053d-7eba-724757dc7d43@gmail.com> From: John Garry Message-ID: Date: Mon, 21 Nov 2016 14:16:55 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <0edd4edf-f7c8-053d-7eba-724757dc7d43@gmail.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.203.181.152] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 521 Lines: 22 On 21/11/2016 13:20, Quentin Lambert wrote: > > > On 11/21/2016 01:53 PM, John Garry wrote: >> However I have noticed that we should do a call to hisi_sas_free() for >> this failure, and later failures in the probe. > I don't understand why, and would welcome the opportunity to learn > something. > We call hisi_sas_alloc() from hisi_sas_shost_alloc(); if we fail after this in hisi_sas_probe(), then we should free the memmories and workqueue got in hisi_sas_alloc(), which we don't. Thanks, John > Quentin > > >