Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2923546imu; Mon, 17 Dec 2018 10:01:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/U67P77HQXS8EVLSx32wdvWI0FmrBXDBsWgLhGWqe8/dAfYc84um8yUH0eXgsJhZz8hNCyk X-Received: by 2002:a17:902:4827:: with SMTP id s36mr13084283pld.168.1545069678444; Mon, 17 Dec 2018 10:01:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545069678; cv=none; d=google.com; s=arc-20160816; b=OwXahCGem06EwxHW5BYl1qDr3k86GN/nzvZrz6wepTmJf2YqF83VKU/sfyZeEoUIOX h76PQI1lAt9f1OdQa5gndEzb2Pn/HTOe5WmoL1gSSfhxQ6ubMNAmBc0s7OF0HS21m0UR NdFe0cMONMNlvaX5i/ycRa4utbxSUkxWF7BgunepbsnRLny3iQDgugQ49QE9ijIZOowa Zd0FMrNx5Cq+UHMMGDJXsT490pl0D+gJBaUPdwggWoXT6TApszu2JhZjRXL9IGixYd4b LeoCNPB48hU/gLzWfw6l2AEekZqTMvp3V+cp0CD/gmbEPwPBujOqup2awTJtgDyg6oW0 h+LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=vVJQtmjP3lIpd0VmRLBq0GeCqRhsW1h4UC4/iN3I8i4=; b=FJgPyCBqi1JjMW8XCoWJnoNjadHe/Xv2XC2RGqHDPvOi+cBhOaWYc/cqyX3dEP4IOM woEUAkuSqmlaoVbqfwV2Ya/eFU5568oE3/j4EhxlI1j93F2GqY5r5WRFlXUGwGU5gGuz 6cIPg2SG1g3kd/1UNNy4msOwZ2cgqnP4ezNnWHyRGAWZQeZgF+q5ib3pN1XcE6b0F1ZF +HucBXBCOjbsrfLoGeisadwMDOedgXwiCwbsqbyjoGGO+yMocLfDkpXZVpS86jclElvd G+qUYhcyRbo4x4kIEOiIkS00LZf3vziGofl9VMIZ6twRbxqG4PvDF7ipQV5kkf9acx5h YyKw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si10599444plk.9.2018.12.17.10.01.02; Mon, 17 Dec 2018 10:01:18 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732476AbeLQOFX (ORCPT + 99 others); Mon, 17 Dec 2018 09:05:23 -0500 Received: from mx2.suse.de ([195.135.220.15]:47994 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726673AbeLQOFX (ORCPT ); Mon, 17 Dec 2018 09:05:23 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6DE21AD63; Mon, 17 Dec 2018 14:05:21 +0000 (UTC) Date: Mon, 17 Dec 2018 15:05:20 +0100 (CET) From: Jiri Kosina To: Pan Bian cc: Srinivas Pandruvada , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: intel-ish-hid: fixes incorrect error handling In-Reply-To: <1542847953-127599-1-git-send-email-bianpan2016@163.com> Message-ID: References: <1542847953-127599-1-git-send-email-bianpan2016@163.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 22 Nov 2018, Pan Bian wrote: > 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; Applied to for-4.20/upstream-fixes. Thanks, -- Jiri Kosina SUSE Labs