Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1365933imu; Thu, 22 Nov 2018 15:06:39 -0800 (PST) X-Google-Smtp-Source: AJdET5fLfLHekvoEH1AlKmJgCUbzsI9afioCYotgEGKRzJmAzHVKehSTAdE1ufRWO7A5vPERdmJG X-Received: by 2002:a62:2781:: with SMTP id n123mr13583743pfn.138.1542927999915; Thu, 22 Nov 2018 15:06:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542927999; cv=none; d=google.com; s=arc-20160816; b=zYwutYsPD31uPuUYQuJC9SaeF0XkhSMxRG1oD5DD5TmFsxxCPQUNjzdA7lyNoQk6+3 XO/8tgaeW4kAkiFMEOBwtvxCeZvXsgNCcvRRjcJfuPJ/6nsv9+faeumVjkLX5wN1V5G9 3zL524peqYDgiOHOExLUM3ACcrLf8bwUdk7RaXY1jBvI7NGax7tAMN//Ezpd0w1S7HYP uZxOs6gJpC0b9o+NDXR3VyX8qOpwrqlhBiTRiySq0Ftwo8tAjjUynUOLs54IlqBaZrK0 8vU2uLmp716wqggF9hq8+K63vEsSyfO+9FDA/vds70425JyAQWitz72cNcSQpwEVE4n5 xcrQ== 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:to:from :dkim-signature; bh=Z9V4SWJuxMzXS08SK2TY5KGlBC+wofk1r/EfrwgsdVE=; b=CywPuUiy0nXNeZuOkAsmIV/ZfOj8yQOsgT6IkKyPX7anC42d/f+1Z+2Igb3sOhOWvQ 3rLwnUBnWiV7MtTSVfzvyWKItk2DuNVzsphYkdOsYeIoQVwovhJZtVifSxPlppb6ANXs oQiz3xUCpADzVzO3Dp+6yblMjwgiUKmLGT1qag7pKRMgzFKHFN5ahcCpi9SND8EXn3Hx MmVTyUHFmrsjVF8QbD4J7nWq/pi7C8l9bdwp6Igyne6Gz6LS4Ur7TEmxXoawU/2k6ORO Yb4malj5aPhrEJLv8j95dNVz3cmydrrgqrFgnhDUv0OF3WVoxyAfq7p0wTSuc53WSpfj zk4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=CyeWGYtL; 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 d189si38802243pgc.393.2018.11.22.15.06.23; Thu, 22 Nov 2018 15:06:39 -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=CyeWGYtL; 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 S2392549AbeKVSHb (ORCPT + 99 others); Thu, 22 Nov 2018 13:07:31 -0500 Received: from m12-14.163.com ([220.181.12.14]:44645 "EHLO m12-14.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728352AbeKVSHb (ORCPT ); Thu, 22 Nov 2018 13:07:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=Z9V4SWJuxMzXS08SK2 TY5KGlBC+wofk1r/EfrwgsdVE=; b=CyeWGYtLPdty4KwvXwe5wYenS6g2KJtD8x uOr3JKJHAISH8KJcEm92HFnk+rlJpu29HXNAy5LjeelYeMwzU+A/57SgG8FJrLxX Ajo7t21A0ONr04+E0+23Pn36soAagDosNvpk0dde3pLCFIZLEm+G2cBGhr3s+LAb 0M5SrIEjo= Received: from bp.localdomain (unknown [106.120.213.96]) by smtp10 (Coremail) with SMTP id DsCowAAXl87MWvZb_HgvBQ--.62410S3; Thu, 22 Nov 2018 15:29:18 +0800 (CST) From: Pan Bian To: linux-kernel@vger.kernel.org Subject: [PATCH] drivers/memstick/host/jmb38x_ms: fixes incorrect error handling Date: Thu, 22 Nov 2018 15:29:20 +0800 Message-Id: <1542871760-48125-1-git-send-email-bianpan2016@163.com> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: DsCowAAXl87MWvZb_HgvBQ--.62410S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7XF17ZFyfXF1kZr4DCw4xtFb_yoW3Cwc_CF 93Zr4fKrZ5ur1UGw15Zay3ur9rtw4vvrn2yw1rtws3X348ur1xGws2vry3urZxWFWUC3s8 CrW7X3WS9ryjqjkaLaAFLSUrUUUUbb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUeSD7DUUUUU== X-Originating-IP: [106.120.213.96] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/1tbiNg4HclWBcSPgbAAAsH Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kfree() is incorrectly used to free the memory chunk allocated by memstick_alloc_host(). Instead, memstick_free_host() should be used. Fixes: 60fdd931d577("memstick: add support for JMicron jmb38x ...") Signed-off-by: Pan Bian --- drivers/memstick/host/jmb38x_ms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memstick/host/jmb38x_ms.c b/drivers/memstick/host/jmb38x_ms.c index bcdca9f..637409c 100644 --- a/drivers/memstick/host/jmb38x_ms.c +++ b/drivers/memstick/host/jmb38x_ms.c @@ -907,7 +907,7 @@ static struct memstick_host *jmb38x_ms_alloc_host(struct jmb38x_ms *jm, int cnt) iounmap(host->addr); err_out_free: - kfree(msh); + memstick_free_host(msh); return NULL; } -- 2.7.4