From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752843AbcLEVzy (ORCPT ); Mon, 5 Dec 2016 16:55:54 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:16978 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752131AbcLEVzx (ORCPT ); Mon, 5 Dec 2016 16:55:53 -0500 To: John Garry Cc: , , , , , , , , , Xiaofei Tan Subject: Re: [PATCH] scsi: hisi_sas: fix free'ing in probe and remove From: "Martin K. Petersen" Organization: Oracle Corporation References: <1480434357-63730-1-git-send-email-john.garry@huawei.com> Date: Mon, 05 Dec 2016 16:55:23 -0500 In-Reply-To: <1480434357-63730-1-git-send-email-john.garry@huawei.com> (John Garry's message of "Tue, 29 Nov 2016 23:45:57 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>>> "John" == John Garry writes: John> This patch addresses 4 problems in the module probe/remove: John> - When hisi_sas_shost_alloc() fails after we alloc shost memory, John> we should free shost memory before the function returns. John> - When hisi_sas_probe() fails after we alloc the HBA memories, John> we should also free the HBA memories. John> - We should free shost memory at the end of hisi_sas_remove(). John> - sha->core.shost is set twice, so remove extra set. Applied to 4.10/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering