Received: by 10.223.164.200 with SMTP id h8csp211192wrb; Sun, 5 Nov 2017 06:32:51 -0800 (PST) X-Google-Smtp-Source: ABhQp+TnVuc4xAj0vWvGUi5b/Al9a1goErVaNFFlCqXRi37V0JLp/gOnAq9trFfhW87Aq68cyCx5 X-Received: by 10.99.116.76 with SMTP id e12mr12512724pgn.126.1509892371488; Sun, 05 Nov 2017 06:32:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509892371; cv=none; d=google.com; s=arc-20160816; b=uxuieDgwSZF8++3+JjUnzxsNjY8Vlv83o45i/4+rKLjklar+Ex77mYw9YkJ5LG84Lq ReoqNgvJ9GmISIAn9OOtii0kiGl1F927r/312t25ajoTaSyorBZ4oppkbo5T1lqajDoU FBwSp5KsObaRuqZb9KGUDg4V5Mkj2unLZAdYrfgyosdioQWhOqtbYS7jkqxTzBbprUfi EsIzCqClMoAxMA1RrPpW68ilmokY7iwv8p0rSkt3OxvqDbRD0HYRn7+QgmJQFWyopXD/ CO0MK4qetb6xWxJWP/F7fU8B/QXYouO6Qt4MKxrfFtXdswhbg/0PY0MTP17Wj3KKFbM0 NnyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=vJja6s6CcZHpKi/Fg6lrpwgI2WD2ItZtagOF+50kwx8=; b=mDTUDPSyW7APvOMnYlaQ6yEyiM69F4Xt/qwQ7ocLkq6FnJlPY0VMrChkrXjGA9s7Ao LRTti1o2sP4pJf2WrPfSzGEL3vYodDnKf0DoV6uEhgl+b5iogBTI/WdfE8W9gYaNvo4H jj7Jx78EVZW01KT94EwEFPc/9+2vJ5Th5MIDzrCt/mDK5vqpm9R6sG/TIF+kq6rOfXJ8 T0kiXOLSgWj1+D/1yP4XdNX6uIyoV28NNeUq7pXBE7OD4ZKqFG69EhkUhLzezStec4hW hS/TmMo3nHwNzjU3iTSsupP2taF8xfNA2w1RWme7w+PwAGqjfQJhcKe7oS6bSGZi8HkM UPYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=kDFEcDek; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g30si10233096pgn.147.2017.11.05.06.32.37; Sun, 05 Nov 2017 06:32:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=kDFEcDek; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751097AbdKEOcD (ORCPT + 96 others); Sun, 5 Nov 2017 09:32:03 -0500 Received: from m12-16.163.com ([220.181.12.16]:55896 "EHLO m12-16.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750722AbdKEOcB (ORCPT ); Sun, 5 Nov 2017 09:32:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=vJja6s6CcZHpKi/Fg6 lrpwgI2WD2ItZtagOF+50kwx8=; b=kDFEcDekTAyniLkOrR8muEnqQs4iMVNkEE TqKoVy36Em3Kh5BOwqeJs390O67YhXkyDBWQTLf2G+LD2K1YCl81K741BsSBe37k JMe8izXFFUgJdR6pNidT47mSsUzLbStC3RbAkm6TrfnLyL/Wl60Cm+GlmSKdi+1k hYogyQHQw= Received: from localhost.localdomain (unknown [1.202.77.139]) by smtp12 (Coremail) with SMTP id EMCowACXcbx1IP9ZuaUhGQ--.7323S3; Sun, 05 Nov 2017 22:30:15 +0800 (CST) From: Pan Bian To: Matthew Wilcox , Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Pan Bian Subject: [PATCH] scsi: advansys: fix improper function call to kfree Date: Sun, 5 Nov 2017 22:30:12 +0800 Message-Id: <1509892212-10489-1-git-send-email-bianpan2016@163.com> X-Mailer: git-send-email 1.9.1 X-CM-TRANSID: EMCowACXcbx1IP9ZuaUhGQ--.7323S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7WryUCF47KF47WF48Wry8Zrb_yoW3Crb_uw 4Igr92kryDGF1xKw1fArW7Zry0ka1UX3ZYvr1Sq34ayryUZw45J3WS9r1rZrsrGF40yw1D ur1qv34fAw10kjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUnI387UUUUU== X-Originating-IP: [1.202.77.139] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/1tbiQBeHclSIT1re0QAAsk Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In function advansys_eisa_probe(), data->host[i] holds the return value of scsi_host_alloc(). The memory allocated by scsi_host_alloc() should be deallocated with scsi_host_put(), not kfree(). Signed-off-by: Pan Bian --- drivers/scsi/advansys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 24e57e7..1f56a6d 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -11678,8 +11678,8 @@ static int advansys_eisa_probe(struct device *dev) return 0; free_data: - kfree(data->host[0]); - kfree(data->host[1]); + scsi_host_put(data->host[0]); + scsi_host_put(data->host[1]); kfree(data); fail: return err; -- 1.9.1 From 1583272878739149813@xxx Mon Nov 06 00:04:40 +0000 2017 X-GM-THRID: 1578978461285776164 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread