Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbdHKAGD (ORCPT ); Thu, 10 Aug 2017 20:06:03 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:17594 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752133AbdHKAGB (ORCPT ); Thu, 10 Aug 2017 20:06:01 -0400 To: Pan Bian Cc: "James E.J. Bottomley" , "Martin K. Petersen" , Johannes Thumshirn , Jinpu Wang , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: scsi: mvsas: replace kfree with scsi_host_put From: "Martin K. Petersen" Organization: Oracle Corporation References: <1502193771-20271-1-git-send-email-bianpan2016@163.com> Date: Thu, 10 Aug 2017 20:05:48 -0400 In-Reply-To: <1502193771-20271-1-git-send-email-bianpan2016@163.com> (Pan Bian's message of "Tue, 8 Aug 2017 20:02:51 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (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 Content-Length: 305 Lines: 12 Pan, > The return value of scsi_host_alloc() should be released by > scsi_host_put(). However, in function mvs_pci_init(), kfree() > is used. This patch replaces kfree() with scsi_host_put() to avoid > possible memory leaks. Applied to 4.14/scsi-queue. -- Martin K. Petersen Oracle Linux Engineering