Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp21388pxb; Fri, 15 Jan 2021 04:55:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJw55EociQhF16hSHqv9XypB5p7R11cHjM+//y9qMhYUK0n2DUBKb/+X56xS9KTMM/J9R1Xu X-Received: by 2002:a17:906:3bc2:: with SMTP id v2mr8744868ejf.291.1610715317498; Fri, 15 Jan 2021 04:55:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610715317; cv=none; d=google.com; s=arc-20160816; b=Y50Jzj6lc+PNHF+Nn4kCe/Y1Ry+oY52us4ezlCGDuZGnP3s2T9Ybacz7LbavIT6FN6 BLFUgsWgUB1/cf1NS6W1YlO63XGmz8gbfsvNYE12K8yUKGqBYnKW2fKLsTv3d6/1KHqt ygeu/qc8Fd/FttIoCLOoZZK4Av4yrSOYgW9BeYZQ1Kohxu5BJfpTCGxD2XyayZHENVlA z1c/NgK3/9m/Z5a70NJoM7bqPhk7TRKG6OZ0IsMCQDgsQGvv1z76mh+MPtlxYQJhS1rZ E+P4WwUIKhQMlDULt9kvDHs3oHbuh/++4sNsFtCiDmE4JtdR85Jf2LHo7gdei90Qv6t8 yA4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+mRIXkAUlhMxYywPrkqTHkYzXOfsfiazEJ2kX+HSqRQ=; b=Ss5ZtYdr4XpIqnZmMcHXZOj19n8igiEYmLxvOX07666vGHnNvM2SPmkA2W7KnB+LW4 JFMjOfIXvF7ul22lgt8mbP4oBtCQ2UFsrALJ0e9IyBiurHAiSB3jWhMX5eNO1juOY/Cc CIzZbZ1Q6u3g4/oWGHnX4iCNDVIPZnESQPNHaPOzB/McMDblLGyMgQbPOnS/hrfLDJ1g N2mWY3KA68Jvi5n0nlMKSf2O2sHJm40TDkmJHtWYzIkTd88UJCJ2aLSkQjC7me/U8xVD awXneikHYrXWL6xBpb6ToPURwB3NTRpus+WcHFnlIR/MgkBJD19XeRkOZ/aoTcjnFv7a 43bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=q7iFy6Qk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk23si3893505edb.368.2021.01.15.04.54.50; Fri, 15 Jan 2021 04:55:17 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=q7iFy6Qk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388089AbhAOMyS (ORCPT + 99 others); Fri, 15 Jan 2021 07:54:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:42628 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387704AbhAOMff (ORCPT ); Fri, 15 Jan 2021 07:35:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A01223339; Fri, 15 Jan 2021 12:34:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714094; bh=BSxJlYx/6c1s9QaRy1D+m8lDjzEWG/SvyAfpM9EsMyY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q7iFy6Qk84TvvY49tqvhns001dq109aGwT7CV+xNt2golpSEjbKf3FTIafX7zctbq TndIxJSGvjotCnfGobWfRBZtiw1v4+jhjsiHUsWUgGiI3z0XaC86tCTd0dXnX1tvfK pG4oDLi1/365l6URRgLarqEwFCDFIYdKczA84jVM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Mika Westerberg , Jean Delvare , Linus Walleij , Wolfram Sang Subject: [PATCH 5.4 42/62] i2c: i801: Fix the i2c-mux gpiod_lookup_table not being properly terminated Date: Fri, 15 Jan 2021 13:28:04 +0100 Message-Id: <20210115122000.430414543@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121958.391610178@linuxfoundation.org> References: <20210115121958.391610178@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede commit 0b3ea2a06de1f52ea30865e227e109a5fd3b6214 upstream. gpiod_add_lookup_table() expects the gpiod_lookup_table->table passed to it to be terminated with a zero-ed out entry. So we need to allocate one more entry then we will use. Fixes: d308dfbf62ef ("i2c: mux/i801: Switch to use descriptor passing") Signed-off-by: Hans de Goede Reviewed-by: Mika Westerberg Acked-by: Jean Delvare Reviewed-by: Linus Walleij Signed-off-by: Wolfram Sang Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-i801.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1424,7 +1424,7 @@ static int i801_add_mux(struct i801_priv /* Register GPIO descriptor lookup table */ lookup = devm_kzalloc(dev, - struct_size(lookup, table, mux_config->n_gpios), + struct_size(lookup, table, mux_config->n_gpios + 1), GFP_KERNEL); if (!lookup) return -ENOMEM;