Received: by 10.213.65.68 with SMTP id h4csp698679imn; Fri, 6 Apr 2018 07:28:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx49EqSwk4Nyxh0C3cZVFD8Tjz9esj3FqO5kYgZ4HUGQv9Ls8jnIYZzuXqtkx+Y4x1JXAnEJA X-Received: by 2002:a17:902:aa96:: with SMTP id d22-v6mr27394140plr.106.1523024919774; Fri, 06 Apr 2018 07:28:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523024919; cv=none; d=google.com; s=arc-20160816; b=bf4wXiHtyHwvwQUgd+4bGU+Ygy/lKmBnG+7gFo+5CyA44JYJeoloxPIcAfpcs8HXVd R5inB6nqoOjnp9PHglRt/ixl32yBZN8LfksWBJBQKszb3J/VpxTOi4BlzHwKdl1yH3xK NrmyfoD6Bbq/1A54q7gLMbTu/GOqmtl4aJUvRsNtchQ0LGb/hCaxeUZ7+/QH5zCs79cZ 6LDgUHGVGYq9kdfsqV71X3oEI431WEDxLhSMWsyvHfwShgklBklubLlm4OiViTGo9Hqm bgHltPU1aVY7/ht0WIgFwLoZFIOF9PUr85tc50JHhXLYy2HHhAl0jRZZn3QO6D/ZwGft xZSw== 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=joMytKz1UVEL9vfejkeFCSU+pWbR5OXcLCnax47YIX0=; b=LGK9L+kXV+/hU1BTKHpynVhS8TcVrzfvnKTTzx7mTcpW5j0CRLZb0clJsKjRj2XsiB gi4FYRmMWvweAo5zb8tCfgobqbOJ1Utd8lDXAVt1igQToXvcRoJov4USSF1Vol+zeiiO D+TR6pcTDKZCCymJ0NQQ2qlnWJvx6Kia+318GceYel/VkKrjMjvMvKzgFJIVbSK3CkWJ rGSFUfnWZ8VODXKvPMlIjw0fOZB7RYnHff8K8RfUK87rdnxJS8NmvfVlvPhTHi7ehttM cdH5lGjK3Chw58byx4yxbiBM4CDiNF5QnQIhac0/EJQmYeom5fW+dMQGYy02S/7AgcRu bpuA== 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 t73si8080235pfg.114.2018.04.06.07.28.25; Fri, 06 Apr 2018 07:28:39 -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 S1756776AbeDFOZe (ORCPT + 99 others); Fri, 6 Apr 2018 10:25:34 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33124 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932302AbeDFNho (ORCPT ); Fri, 6 Apr 2018 09:37:44 -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 9E2AA407; Fri, 6 Apr 2018 13:37:39 +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.14 14/67] i2c: i2c-stm32f7: fix no check on returned setup Date: Fri, 6 Apr 2018 15:23:44 +0200 Message-Id: <20180406084343.175222182@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084341.225558262@linuxfoundation.org> References: <20180406084341.225558262@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.14-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 @@ -887,6 +887,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",