Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ECABC43381 for ; Tue, 19 Mar 2019 09:03:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D841520828 for ; Tue, 19 Mar 2019 09:03:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726981AbfCSJDO (ORCPT ); Tue, 19 Mar 2019 05:03:14 -0400 Received: from mga14.intel.com ([192.55.52.115]:28605 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725934AbfCSJDO (ORCPT ); Tue, 19 Mar 2019 05:03:14 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2019 02:03:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,497,1544515200"; d="scan'208";a="156281628" Received: from kuha.fi.intel.com ([10.237.72.189]) by fmsmga001.fm.intel.com with SMTP; 19 Mar 2019 02:03:11 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 19 Mar 2019 11:03:10 +0200 Date: Tue, 19 Mar 2019 11:03:10 +0200 From: Heikki Krogerus To: anil.kumar.k@intel.com Cc: gregkh@linuxfoundation.org, brian.j.wood@intel.com, stable@vger.kernel.org Subject: Re: [PATCH v3] usb: typec: fix bug in typec_register_port call Message-ID: <20190319090310.GQ7752@kuha.fi.intel.com> References: <1552689801-16754-1-git-send-email-anil.kumar.k@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1552689801-16754-1-git-send-email-anil.kumar.k@intel.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, Mar 15, 2019 at 03:43:21PM -0700, anil.kumar.k@intel.com wrote: > From: Anil Kumar > > typec_register_port function used variable port->id without > initializing it. This patch fixes the issue by using the local > instance for the error case > > Issue is not observed in the mainline tree (5.x) > > Signed-off-by: Anil Kumar > Fixes: bdecb33af34f ("usb: typec: API for controlling USB Type-C Multiplexers") > Cc: stable@vger.kernel.org #4.19.x You have the tag, but I don't see stable@vger.kernel.org on your CC line? I'm adding it there now. The patch is otherwise OK. Acked-by: Heikki Krogerus > --- > drivers/usb/typec/class.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c > index e61dffb..5a442e4 100644 > --- a/drivers/usb/typec/class.c > +++ b/drivers/usb/typec/class.c > @@ -1611,7 +1611,7 @@ struct typec_port *typec_register_port(struct device *parent, > typec_switch_put(port->sw); > > err_switch: > - ida_simple_remove(&typec_index_ida, port->id); > + ida_simple_remove(&typec_index_ida, id); > kfree(port); > > return ERR_PTR(ret); > -- > 2.7.4 thanks, -- heikki