Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp731955imu; Thu, 22 Nov 2018 04:37:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/XQvN8PwvWJzS3HG3Qm8UhWtKyNHMBI2YlsR7Nknm82azpwPr3IEZveV6G3r+OqxYF+8IE+ X-Received: by 2002:a63:ca0a:: with SMTP id n10mr10009561pgi.258.1542890262253; Thu, 22 Nov 2018 04:37:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542890262; cv=none; d=google.com; s=arc-20160816; b=ylH019Nynm0J7cfntjQ5S+WD8cTO0yEcwq/1FGs1siNDqZCViIs3J0S1LENLk1fIYU KGGAmiEKedeMoPeq3VR6qePs51t/jmIX5FnjOfSxn7uTKfV3tNGNL1hC646Gd5aZEHOx qo5LOrYikCta2Gdc+LIDpalXcMQUAPtrSuFA6eIN33JdNlG3TmtnPxbR+hTCWDDyAzN5 44yzUC6PVJHeh8AvO+h2+r+7ioa1rnNg4W8ptFlObHZLTE9IC9C4iUsvcrjNTdjAUccs vZxFMWUMHUS82LVkazfrvoFGLDQr8gXYO2XCHG08n4dx4Jg7W0g/byYgvMBaqiIQgDiW Xb1w== 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; bh=akRecIb2Nt5PB9XUGzrQgjz6hGCO9LX8e6BLtxJ2jlw=; b=eyWlUpqngZUnCz+vHaLIwKOf3c1QIYjwhKuiUZPwPpzZC+5XDzyABVyUer26l7MCsZ B0W4noc0d0572ZtAhj8reTaEZcdUKPMnygTy37lyMeuA8hqotFhwz3lpjXbWEmutQV5b UszW2qjv3M6Clr5Ig71uqfG53HxVsv+mILnXswd8yh/gfotNiEz41XzCjbWIxIkTHvP5 M5+qZR4dDLBNmROtLEcCpl8rLpfTllmzwtcyBJNIlAcaaXHU5dCXVz2f5h/FoL6ACEHa AFg8RvKAwodpom3EIRZbWoKucQbu8kRNOehx5QVo4mfaTTrI3ymGu8FyotwIJwxYXFeD EOYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=bhGuliJv; 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 b14si50786361pgj.20.2018.11.22.04.37.26; Thu, 22 Nov 2018 04:37:42 -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=bhGuliJv; 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 S2390955AbeKVL3j (ORCPT + 99 others); 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; } -- 2.7.4