From patchwork Thu Nov 22 00:52:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pan Bian X-Patchwork-Id: 10693337 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94A1214BD for ; Thu, 22 Nov 2018 00:52:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 758881FFE6 for ; Thu, 22 Nov 2018 00:52:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 679B52C4A6; Thu, 22 Nov 2018 00:52:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E329D1FFE6 for ; Thu, 22 Nov 2018 00:52:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388599AbeKVL3j (ORCPT ); Thu, 22 Nov 2018 06:29:39 -0500 Received: from m12-17.163.com ([220.181.12.17]:51034 "EHLO m12-17.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730678AbeKVL3j (ORCPT ); Thu, 22 Nov 2018 06:29:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=akRecIb2Nt5PB9XUGz rQgjz6hGCO9LX8e6BLtxJ2jlw=; b=bhGuliJv8kExCRX4PBSLgiscvp1pPxQs7o OL5SHEajcL4n2mbu3YcWHoYdpruCV/5RwAp7k3UIZi90lfc2CQf2alckVOgyjqVH mUCihU0vbyamTpUxhqAdjiaMaRKtOJE6CJfArOyn46Ya9+Y56haPTcLqyKArfFd0 lNFe0Eueo= Received: from bp.localdomain (unknown [106.120.213.96]) by smtp13 (Coremail) with SMTP id EcCowACXPnfO_fVbSPFVBA--.3905S3; Thu, 22 Nov 2018 08:52:34 +0800 (CST) From: Pan Bian To: Srinivas Pandruvada , Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: intel-ish-hid: fixes incorrect error handling Date: Thu, 22 Nov 2018 08:52:33 +0800 Message-Id: <1542847953-127599-1-git-send-email-bianpan2016@163.com> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: EcCowACXPnfO_fVbSPFVBA--.3905S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrZFy3WF15ur1kJrW7tr43Jrb_yoW3Wrg_Ca 1jvrs7ZrZ7trsavw1jkrW3ZrW2kaySgryF93Wxtr13Aa4xAwn8Xa18Xr4rXw15WryYyF93 XFWDXr1fAr13CjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU5-vtJUUUUU== X-Originating-IP: [106.120.213.96] X-CM-SenderInfo: held01tdqsiiqw6rljoofrz/xtbBzxMHclaD0XVjPgAAsF Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The memory chunk allocated by hid_allocate_device() should be released by hid_destroy_device(), not kfree(). Fixes: 0b28cb4bcb1("HID: intel-ish-hid: ISH HID client driver") Signed-off-by: Pan Bian Reviewed-by: Benjamin Tissoires --- drivers/hid/intel-ish-hid/ishtp-hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/intel-ish-hid/ishtp-hid.c b/drivers/hid/intel-ish-hid/ishtp-hid.c index cd23903..e918d78 100644 --- a/drivers/hid/intel-ish-hid/ishtp-hid.c +++ b/drivers/hid/intel-ish-hid/ishtp-hid.c @@ -222,7 +222,7 @@ int ishtp_hid_probe(unsigned int cur_hid_dev, err_hid_device: kfree(hid_data); err_hid_data: - kfree(hid); + hid_destroy_device(hid); return rv; }