Received: by 10.213.65.68 with SMTP id h4csp675209imn; Fri, 6 Apr 2018 07:08:40 -0700 (PDT) X-Google-Smtp-Source: AIpwx49k/gOph4IQbYlbLLbPVK/RZUf0C318soiT/qYg1oGKauL8dp4QVbhiI4/KmSu7NprmOQ1h X-Received: by 10.98.253.22 with SMTP id p22mr20562277pfh.217.1523023720275; Fri, 06 Apr 2018 07:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523023720; cv=none; d=google.com; s=arc-20160816; b=ve7oD0enrjpUXF374d934JoDDCyrTSyh/VaqQy8bkowZ6uaSdtMORx8bEeU8qWglSx ngXX+Tik1lHwjalLGGmbFkW6WjE2XDqZk+wjaw7L4uLTr/7ynlltoCMCzKN8gf218gho OmGhLyJ/aT6PKbC2lKXrUdt9zkCpT9mPZnFY7t3XJXtpry3lzecGjKqk4nu/iRphin8J h2YPHQW3+PpwW5S4nC7PvOIoPOG/lqjJc1oc+F2ckyuzkT0cDJwiceI6jrxLVOVLamJH PvTHosgajwHn2asScaIwIUH8vWMW1KKCJVcRxbrEWkRoDRw0YKthGfLYugTKB22CLqGP kMhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=7CccnfwMYlK66WN8GR9mdNLAP/fcrsK+Y3dcEXznVpM=; b=V13KbNHtZoff87CIsi8mFEqcczz2o8zo/s5FqLbva0xB2OfQiYnqQiPPiZsHcw482d 5EJmPjOo0lEX8XIT1i/TI9WIOAxgFm7wwoCaTzcpVF27iBxTmiOpOJg2xdu6XziIhLaH HkgBQUn4Edjx5MM+HObe+I549S8tZnpDijAbtxWSd7c7/HsS9fxc7IYDT8jgvSNHNsbw /i3T0dhx1kvkt9forGFY/VmqHkv6W1ez6QhJFG7GkTpFGQjOpTU2mPzTiLH1Dn1B+8Qg M+g4wDoXMDXmf1/9vGyj3ALD03tltvciZ0AeuXRO/D1qGMRYTYMybSaXzAI1g+AnaF54 RTGw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q24-v6si8470134pls.3.2018.04.06.07.08.26; Fri, 06 Apr 2018 07:08:40 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756409AbeDFNlB (ORCPT + 99 others); Fri, 6 Apr 2018 09:41:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:36068 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932815AbeDFNk6 (ORCPT ); Fri, 6 Apr 2018 09:40:58 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D5669DF3; Fri, 6 Apr 2018 13:40:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pierre-Yves MORDRET , Alexandre TORGUE , Wolfram Sang , stable@kernel.org Subject: [PATCH 4.15 14/72] i2c: i2c-stm32f7: fix no check on returned setup Date: Fri, 6 Apr 2018 15:23:49 +0200 Message-Id: <20180406084350.661098580@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084349.367583460@linuxfoundation.org> References: <20180406084349.367583460@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Pierre-Yves MORDRET commit 771b7bf05339081019d22452ebcab6929372e13e upstream. Before assigning returned setup structure check if not null Fixes: 463a9215f3ca7600b5ff ("i2c: stm32f7: fix setup structure") Signed-off-by: Pierre-Yves MORDRET Acked-by: Alexandre TORGUE Signed-off-by: Wolfram Sang Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-stm32f7.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -888,6 +888,11 @@ static int stm32f7_i2c_probe(struct plat } setup = of_device_get_match_data(&pdev->dev); + if (!setup) { + dev_err(&pdev->dev, "Can't get device data\n"); + ret = -ENODEV; + goto clk_free; + } i2c_dev->setup = *setup; ret = device_property_read_u32(i2c_dev->dev, "i2c-scl-rising-time-ns",