Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7236829ybp; Wed, 16 Oct 2019 05:57:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwiV4AZDyZqm4KivrSbj8KzznulWqc5HFEEQV9gEf43E3y37jSxfl1AnyFpSRYb5c/shlhR X-Received: by 2002:aa7:c603:: with SMTP id h3mr39071468edq.44.1571230662884; Wed, 16 Oct 2019 05:57:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571230662; cv=none; d=google.com; s=arc-20160816; b=RT/YZ6cajNz6NJW9t0v085CuKRYN3lDg0VQDNZDxgYNu94ZucC5lHt21FW2oiHvp1e hrlRpdxFWNfJVVepeoV3mL02hy6gbHrR2wFZcI/LeRhTqI3+ufIUfG8EnuRVTR9P2JF0 hzHd2svf2y0nn3fdQ3cAQfx/1BWcZNaALBlq42XNg5mnplyu3FqhdwGS9BjbCpME4ZKG WEnxBdqp85CbjURTzKpbBzzTpFdp33h6z0F1Ipm6YDOVqBQJyr6xmK1LABTbvrcsV7D6 f3CNEY6SwGCvmcayeXsalHxZMXO+3rUb5enK9IkKfkZU5h1Y0Dusa33iRyk9L/Gohc7S mvog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=UFOAm0KEEOL2hee760g8AZEKV489IZzr5TEqXGhsPJ0=; b=WSAUWS3eXkKP1PfaFaW5rluo42P5pvvU4idfIKZ3Es96TNop1IRxnE/LNz0lQ6V5Ok 3kSRW4mV6W+BOboEWOR2df/7LeRqlMOI3YYxsUt1ekb3Ewm3CkvN+CNr8xpwAQboH1JX 3fXTDESf8rqIQvwAzfkTIE5Q/tabVuA800Kl7t/RouNf+7pjkM0AhI9Y8deHPfZGRL5M YVcLQn4H2lMtraoK04+JV60sUye8yFHZZQwtV1A7mXkW9JJLG7IA86t+zVK3HH6k9/ov kcc0i6372I7Gj6AlFsAj9H8q+8wkNieuRTDtaFBI/ygwF4Y7P5J+OFr6d1WtVTVZ3ZMM TKkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Pjvu+S9c; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si17169009edl.170.2019.10.16.05.57.20; Wed, 16 Oct 2019 05:57:42 -0700 (PDT) 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=fail header.i=@gmail.com header.s=20161025 header.b=Pjvu+S9c; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391430AbfJPIgG (ORCPT + 99 others); Wed, 16 Oct 2019 04:36:06 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:32937 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387395AbfJPIgG (ORCPT ); Wed, 16 Oct 2019 04:36:06 -0400 Received: by mail-pg1-f194.google.com with SMTP id i76so13867654pgc.0; Wed, 16 Oct 2019 01:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UFOAm0KEEOL2hee760g8AZEKV489IZzr5TEqXGhsPJ0=; b=Pjvu+S9cr1LuhjKwbTEv5zAdliS8WLrFYSV9ajCz3Q/g4wItEtxZ84LHPaBzLPQsQn evHe1kYjcS468/RoFpq3ShSUZR4iGEFWGAI4h7GGFPZU0/qQkfM4wN8r/FOELtWUvHE4 Ax7xGEsXESpgj5OHeVJH19bSPDRHuVaTzWHZEGjWjCU0PbobeiVNYY0AIlAg/Ohf8y54 mJTsl+6XIAeKPy9Hp2gJpdXOrWmWj2ysOO/ErFYDFiMaTqYGtxD7rrBR4GHuVDUZdAz5 eqwy0LF+aVyOEVQCvkb6iOP8QiN0c5b88OV2VLvEQ1ipHgNu3x7h7zVB62tighmBqm+k rkqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=UFOAm0KEEOL2hee760g8AZEKV489IZzr5TEqXGhsPJ0=; b=qYlG0qcfjmApDCq/WhTxgiLsIaC+HLvQHDIroOPrAJEAUuPBKBCseV5qPdXdrHxTIi q2tC2yVfSvmVWa1b/u1qItwMlX2H1nHJrgqIN1wwJvEjHrOe1Ot1McCbn6pvi75LEDD6 iVukFt5cdY8LvA5cSzRac3v7fLAXKWXqbQ5fF+K+MwOxCG0grtNogNqqyTemLCCUGuiy e2U31hzAvfw9ne6qoodmSuHBlshmLORpwceoEK+qYZ1GJrKd8Lv4Z77Pn51nXdgulY4d e5Mp50KaIxHy0+bRF6qZJAr4n21f2k3zDtfJme/X2A+vtQjNr91qBUbTMuJhVp3d8Icp fZMQ== X-Gm-Message-State: APjAAAUIXY8XuXZXUI2zO+SvC65oy6yzC9gBDzRKsy3AAG16PDDUfqUL CeEC2iTq7kAvL/tQuVq2GjMxAfT1iKw= X-Received: by 2002:a63:2049:: with SMTP id r9mr5005744pgm.257.1571214965347; Wed, 16 Oct 2019 01:36:05 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id y66sm23847751pgy.23.2019.10.16.01.36.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 01:36:04 -0700 (PDT) From: Chuhong Yuan Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] USB: bcma: Add a check for devm_gpiod_get Date: Wed, 16 Oct 2019 16:35:32 +0800 Message-Id: <20191016083531.5734-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org bcma_hcd_probe misses a check for devm_gpiod_get and may miss the error. Add a check for it and return the error if a failure occurs. Signed-off-by: Chuhong Yuan --- drivers/usb/host/bcma-hcd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/bcma-hcd.c b/drivers/usb/host/bcma-hcd.c index 2400a826397a..652fa29beb27 100644 --- a/drivers/usb/host/bcma-hcd.c +++ b/drivers/usb/host/bcma-hcd.c @@ -406,9 +406,12 @@ static int bcma_hcd_probe(struct bcma_device *core) return -ENOMEM; usb_dev->core = core; - if (core->dev.of_node) + if (core->dev.of_node) { usb_dev->gpio_desc = devm_gpiod_get(&core->dev, "vcc", GPIOD_OUT_HIGH); + if (IS_ERR(usb_dev->gpio_desc)) + return PTR_ERR(usb_dev->gpio_desc); + } switch (core->id.id) { case BCMA_CORE_USB20_HOST: -- 2.20.1