Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp619924imu; Fri, 7 Dec 2018 06:24:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/XpI+Hq6hLU4405SpV8ugLWsMj4KIFh8hr9pgGkRR0I/vjyX1N7bdfbGnG9MYvLRAuXQDOE X-Received: by 2002:a17:902:4324:: with SMTP id i33mr2253652pld.227.1544192682867; Fri, 07 Dec 2018 06:24:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544192682; cv=none; d=google.com; s=arc-20160816; b=Wpr73I1oV6CNa5GuI7+jrlNxObWxc92KJIxpA2zL6R8PxKadztyutbYyUZBY+7fHMd 2zLy7mCcztZL60R4J1I9lor++IyCxlIBVIA0Dny6q3h6thiPh3t+0rVfOp5bpFGE0ftl b0Q7DLlzR9UsHfrimUbdhZsLntaMRsrUnu0jx9pEUeFdsDiX42SokhyrkuAU67UOVPB+ lGmAyTNiPYx5LybsfX2xqA8UVEo167mGXGyrdVwekIdBVex3j8YxGCS8xZ0YdwM3GpiL rCEOegQbw9BzR25/u+VHOS3fvj7MAXh+pygcSQolPOWi1ex+Vidkt9CkbWYhM93C++Vt ddIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=SBi8OMzz9PhXEeDMdOvhtSmgrBsqnPU60l5oPu5aQ40=; b=KzMW6sXie3eqVITXCK4uyYYBd8woiUN2f93lWRD5WiPB33Zh/jdjhbA/9AumsUmBkr d7pHeohUF33EKurGtA0JQpKexwfVwzEariifi36CNniy37D5Vj/EBuaE98iyE05OWWo6 5HsojkDuCW+QVcdp1AY3j19dt6qG6jHtEJmI21Tuqw0fJlJ8Gbx82vlcnh6r5o2RL9a+ B63OM05M65IgGtTWbHEX6acmR2eeqUw9x+2ldac10ZdUPe5MHJrkp8yXssDLEH2aSGod mSsUh6KM+vKinTs2zylkHB/53EMGtwCnh9Rq+TjLJHlAxzO7j/3mf02HhVYaMuTAmfF0 jNHA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m188si3335954pfb.266.2018.12.07.06.24.27; Fri, 07 Dec 2018 06:24: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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726152AbeLGOXo (ORCPT + 99 others); Fri, 7 Dec 2018 09:23:44 -0500 Received: from mail-qt1-f193.google.com ([209.85.160.193]:44900 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726137AbeLGOXm (ORCPT ); Fri, 7 Dec 2018 09:23:42 -0500 Received: by mail-qt1-f193.google.com with SMTP id n32so4574935qte.11 for ; Fri, 07 Dec 2018 06:23:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SBi8OMzz9PhXEeDMdOvhtSmgrBsqnPU60l5oPu5aQ40=; b=BUbM4esOw8cnpOqCFurO1O5VziNWW6iII4kETYxILeUq0h9HrzVGXAsa62iyh4RAu/ CafWpjmU13G/JmgV1qUY18K4ehP8ITCvT4L4C6rsZ4sWVuEKoG0r74tSo6IF7OCOqna3 wmY9ykiyGMsnwVnpRoCko83lQ60b8t9XpOOynd5mI+9r0pnrCMgt/eTA0W4NSXmDGrak otYeI3bP6UrR7MxgfTPRENNrQD1BtyB0X1BYWDSlIsa9rhV3cwrjJX7DYmWS1ifW/ySi +zXbPq6Rq+h6xl7KmnEFbCRJTgahxhQcTRsKPj4r5/8NMA2//iCbM38fwbqabSVGMvI2 UyMA== X-Gm-Message-State: AA+aEWZJY1DVgV8otIubF+y39vVxYSvkZw/L/Eu6iYvv0DQizGJhqJhj NA3FVaEVoAoBerorBvp4Vqhr8uUfPQCdYu3Nq5jiVQ== X-Received: by 2002:ac8:1d12:: with SMTP id d18mr2173615qtl.343.1544192621644; Fri, 07 Dec 2018 06:23:41 -0800 (PST) MIME-Version: 1.0 References: <1542847953-127599-1-git-send-email-bianpan2016@163.com> In-Reply-To: <1542847953-127599-1-git-send-email-bianpan2016@163.com> From: Benjamin Tissoires Date: Fri, 7 Dec 2018 15:23:29 +0100 Message-ID: Subject: Re: [PATCH] HID: intel-ish-hid: fixes incorrect error handling To: bianpan2016@163.com Cc: Srinivas Pandruvada , Jiri Kosina , "open list:HID CORE LAYER" , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 22, 2018 at 1:52 AM 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); Looks good to me. Srinivas, any comments? FWIW: Reviewed-by: Benjamin Tissoires Jiri, do you think we should send this one as 4.20/fixes material or wait for 4.21? Cheers, Benjamin > return rv; > } > > -- > 2.7.4 > >