Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp7378359ybp; Wed, 16 Oct 2019 07:50:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDfvHsUpm6POtpRUWaoJfYk2WSrMLh3g3//8xz10hldHL9q2yzpuxBof97AILZYPG1yo2E X-Received: by 2002:a05:6402:12ca:: with SMTP id k10mr39618707edx.91.1571237425912; Wed, 16 Oct 2019 07:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571237425; cv=none; d=google.com; s=arc-20160816; b=WZMRxIRerAjyVn5SnRgVZpS5rgeuvHf65pFR6cr74KJXfah2TKDCUsXP4fp21caJeB TJKU6HecXZslnfnuU6BTN37a2gFNTP/4P73Gmxt+U8SN2mwk+VQ5TGxY4QlNg1LBnidB LsER3DtSgk+Rj8QFq8N4P2tYoh3OKUhbBAFISHfCQbPvnQ5NW+Jcmcd1H7ivtCr3t44/ wLFgYD451Nd1qe/jW1u1w871mVRr/r1wulH8APLKVxl37T1hemBmb2l8D4WngHwK10ge KlQIteH5FohLsHZ75UBHDuwONrbiVCRNyt3XJHSuLiT+dh3KsWr/B645iHJPw+Ppn2L6 6pYg== 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=gvBJmdm/y0qneuBUivymKny+YKAZ1hnIBVUrDzRfAMY=; b=Atm+zJifH2wP8odxPLnf1Wh/S0VnFGoUWDEEdq16SxY2/tMZnF+pBJTYkr+qzppSL+ LuNi4HUwxTj+8l/CO8qUG0xjK1C3fKh6oxxsBJiB3bZASytWGtmo3mkK0azopKalFxRH oy9ibS4jZduUJP/RonHz8NzMsqSs/P9e2DdN1aScYPkbS2cE5dIMARD1H9+/qvwgXKgJ qg+9R3/yzcf9hxUJWAmNFiMn9t6p2qtU4asrldlwMLwfN5SlIViEGK6xveC5LejlHSf/ 4G2T0P+Vap0QWAd56ueZsblDFc57iaShXgaqf++dM0nEeIXaL9fQ1e5w0xZnYOy4IIjl DaJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=eB0K7G6a; 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 t18si15477870ejx.135.2019.10.16.07.50.02; Wed, 16 Oct 2019 07:50:25 -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=eB0K7G6a; 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 S2390478AbfJPK4U (ORCPT + 99 others); Wed, 16 Oct 2019 06:56:20 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:42130 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730251AbfJPK4U (ORCPT ); Wed, 16 Oct 2019 06:56:20 -0400 Received: by mail-pf1-f194.google.com with SMTP id q12so14482389pff.9; Wed, 16 Oct 2019 03:56:19 -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=gvBJmdm/y0qneuBUivymKny+YKAZ1hnIBVUrDzRfAMY=; b=eB0K7G6aSD0aLTiq84kb+arRKYxrikpQEExHPmvnHAVCgkrTQhC8t3ejGB9jZSfUy5 Rq+ByXYHgvaX3HGYV+sXCgUuuBfXL7u0S2Wfv50wyd1AeE/zLGBQoLks6l9oq2ubPSU9 tf8yvtHBWuNDtuYNoKvhXZkY354bsu+oliCnbkThAR7p1npgU7HxmMIIq4lgDNYNSOjO OK4XaH074YjHhO6y80ESh7+LmKzYr1BezfeVah6S8Pc7hYlTD9BoX719RjmK9L8Bh+tm S1YKnGlI+O0IzO7ppyncZ2AzUjbUPSe2bk4uuCb2eVnpA5N01yYDDFuHkteGAi5jop57 VbKg== 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=gvBJmdm/y0qneuBUivymKny+YKAZ1hnIBVUrDzRfAMY=; b=Wx4sDFJRG8zpsH0DJDzbCdRBJt37zT8yD/yc05vT6gzjGirTg+oz8GaozCaMJsKsHK UQcPyJorhq5eFXpaE6z6RS5aMqw4xwZBTaCObh+uKRTnZrO56BMjx81PmYtPKmjnltgy Nu1d4XLL6dER4zzgIgtzGNuRUmI8Dr3fpx/ga+JsBMFkpwQ+4UUJLHQz5HxcG52qqUaW J7C6lswPfL5520BeJybEFMSTDxsnS+lOxUnyNhlhowODZlcKbI3LdJb/c/uXTZUSntqm ZVvF8F4Wg82AUtM5Y/QRn0JuCT5AkJ6B1oC6KUOcXd8t7YuAUcBYPvJDt4dy5NBSuAQe v11Q== X-Gm-Message-State: APjAAAXowJ+tTWEjh3vI2GW8DctR8OYqsKNFiWYnQci/jbNYWn6L7afn doQz5r7n3SPudxx/hG+JNb4= X-Received: by 2002:a63:3304:: with SMTP id z4mr44315923pgz.225.1571223379149; Wed, 16 Oct 2019 03:56:19 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id t68sm23055026pgt.61.2019.10.16.03.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2019 03:56:18 -0700 (PDT) From: Chuhong Yuan Cc: Mickael Guene , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] media: st-mipid02: add a check for devm_gpiod_get_optional Date: Wed, 16 Oct 2019 18:56:04 +0800 Message-Id: <20191016105604.8036-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 mipid02_probe misses a check for devm_gpiod_get_optional and may miss the failure. Add a check to fix the problem. Signed-off-by: Chuhong Yuan --- drivers/media/i2c/st-mipid02.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c index 81285b8d5cfb..d38e888b0a43 100644 --- a/drivers/media/i2c/st-mipid02.c +++ b/drivers/media/i2c/st-mipid02.c @@ -971,6 +971,9 @@ static int mipid02_probe(struct i2c_client *client) bridge->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(bridge->reset_gpio)) + return PTR_ERR(bridge->reset_gpio); + ret = mipid02_get_regulators(bridge); if (ret) { dev_err(dev, "failed to get regulators %d", ret); -- 2.20.1