Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp248510ybg; Tue, 28 Jul 2020 05:11:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0fmaL95QnWoTaLjx+zlIOEBO3ZdS3K30b5sqXtENDGP0x2kTmyz5wbrBfOZQ78MdbHaE7 X-Received: by 2002:a50:d9cb:: with SMTP id x11mr24839469edj.93.1595938296710; Tue, 28 Jul 2020 05:11:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595938296; cv=none; d=google.com; s=arc-20160816; b=ZX5CyLgTyHM9wdw1LE8Kg7xcV0yXNxHguv1yGthzV24JR1n1d6p3OUssZjHdt/rN8E nABt3crPw3DlyyT49XdpsvGWEXn6sK0K44u2WsyXCTuOJNG0R/v+PPKzPUuzubPf0aY0 vXyrdDvyN1rHFWT4ed9I4cHrxaU+Fann8U67vVGeRlp8UtlJbdSgMeDS+MqfSlXeDOyO axlY8Cb0spO7sb+a7cXCcLlgl8T0MiJx0t1vhp8XXEebyNhaCoqgSFS2cy1HIdu/GjA0 Rq0TOhczmQxTOt22m29os7TJ8qtkRNDy9frC0pMM3Q/efoDINq67crensoj0B4Hjb1bn B9Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=UOMEMfhXFDp9hrASuPHblI/rqDC1yFwOJYeR0PdkfW4=; b=eVMz4VMeQ9MGVp6uY6y68O+NAmlSZUHDi+AHh8/5UXqZCrt5iL4Ol/kIj03ElaDjiz qoJIRD0ImQcxR4CSpgWP0TghIHs1ROlwOupnqSg/hNeOZzomJ0itI8w8bJeq+PZWqH4A ihKAda59H3uZsUPIHOR2Iy4eBHFxeBgq1SnG5vrhfwztHHq1dbtflDMTlHRZsYjRWB+j RcwUwAD/E6Z0iDqWvsSw0h3l+YEWCQKEFPT0JejsB/3oMaPN1rvldg8ZO4agWINJh9IQ jIA1KGkdOXb2DZW1XYusJZ2U67pzriYLR36xQxwTv5O2OiL83+Q9VPERRUBacXIaVY4x kN2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk2si4377898edb.542.2020.07.28.05.11.08; Tue, 28 Jul 2020 05:11:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729244AbgG1L4v (ORCPT + 99 others); Tue, 28 Jul 2020 07:56:51 -0400 Received: from mga09.intel.com ([134.134.136.24]:4606 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728268AbgG1L4u (ORCPT ); Tue, 28 Jul 2020 07:56:50 -0400 IronPort-SDR: McS2wKE0XI3MB/Q3ZRFvefwgw9WUtPEYe9XON+y6C7US38VzFW8hf1wW9CicZMkqkQScbOSlGP zxAbM1Sen9rA== X-IronPort-AV: E=McAfee;i="6000,8403,9695"; a="152445565" X-IronPort-AV: E=Sophos;i="5.75,406,1589266800"; d="scan'208";a="152445565" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jul 2020 04:56:49 -0700 IronPort-SDR: S2/dcYrIit3AWvum25eTbvPfg1pyeTNBZm4i1SqjNH/oUjcIdlDrGIHuycF+4og8shtMN/Htrh UDUc4MtqgIhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,406,1589266800"; d="scan'208";a="394310584" Received: from kuha.fi.intel.com ([10.237.72.162]) by fmsmga001.fm.intel.com with SMTP; 28 Jul 2020 04:56:47 -0700 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Tue, 28 Jul 2020 14:56:46 +0300 Date: Tue, 28 Jul 2020 14:56:46 +0300 From: Heikki Krogerus To: Kyle Tso Cc: linux@roeck-us.net, gregkh@linuxfoundation.org, badhri@google.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] usb: typec: tcpm: Error handling for tcpm_register_partner_altmodes Message-ID: <20200728115646.GE883641@kuha.fi.intel.com> References: <20200714033453.4044482-1-kyletso@google.com> <20200714033453.4044482-3-kyletso@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200714033453.4044482-3-kyletso@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 14, 2020 at 11:34:53AM +0800, Kyle Tso wrote: > typec_partner_register_altmode returns ERR_PTR. Reset the pointer > altmode to NULL on failure. > > Signed-off-by: Kyle Tso Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/tcpm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 82b19ebd7838..a6d4b03ec250 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -1061,9 +1061,11 @@ static void tcpm_register_partner_altmodes(struct tcpm_port *port) > for (i = 0; i < modep->altmodes; i++) { > altmode = typec_partner_register_altmode(port->partner, > &modep->altmode_desc[i]); > - if (!altmode) > + if (IS_ERR(altmode)) { > tcpm_log(port, "Failed to register partner SVID 0x%04x", > modep->altmode_desc[i].svid); > + altmode = NULL; > + } > port->partner_altmode[i] = altmode; > } > } > -- > 2.27.0.389.gc38d7665816-goog thanks, -- heikki