Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17257ybl; Tue, 7 Jan 2020 13:12:33 -0800 (PST) X-Google-Smtp-Source: APXvYqxAPaIMic8i2/3vTzQC+NLKYVu2Qe4mZsFto+9jMOTFsIzego2xo03B92pYnf6io2TnX+Q2 X-Received: by 2002:aca:d806:: with SMTP id p6mr352474oig.17.1578431553441; Tue, 07 Jan 2020 13:12:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578431553; cv=none; d=google.com; s=arc-20160816; b=QHzHQbY+jslBE+sIqeGtZX6VPVuyMeIktTu+mkyR+ooSb/S7B9qWzr5XmFl57yt6oe o3Zk845mW/vX//xpA3u3ubgGyrxDZJ2c/YQ4NXQbmwu2RUK6VPci+LOeDUE/xweDNN+d ohVpzcAxXqRyFJhuHA1y+WJJNsYIIIgMO9cvdEqNENtRtowA3Kikq/zb2D5W+EI9URZh jzA2KwQadXi4WJcOZ519ffAqITR5DzN5AK+UWHhrVpkJ1kA4MW47LKDFQdDlxKGKxiRb S7fc37Eo5gavSSiRHLkEH8fySmPDqfFhJqoJgpU33tbY2fD4Mr57Mrl+WecBbkKkupTK Uw5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DkCmWhlX+vxhgbpazOMVMG/9Qic9+k19jF34nPIPPZk=; b=gIVdURh8gQ3LFReI5m4swOoLrFM2dlTygKCsbX1CqctIgw5R+d2158Fshz+AyeWi+W 6flUjCoqhjVIxg992F+awJ+v4ARB0ZMLfh6tm/FSe24ceGxWH58hI6sJvPeyuvup4Vbz Bsvk99A1Dj7D+hZzuZHt7Ok758OCjCA+PFxoq7WQUkfKEvFWVJTMD1VJxRGgFFLO2pNp YzNJ/jBINIWQmJ3Sdorwe49Yx5WhPHSX1RZz9NKukSmWg1g3kVO8u2E8JGfqSLI/Bg6i 7L6+VF6qkRuQIWpHN6jVOHrnoFNal5TOdTYbjOBslah7jONNAHJTxvE+EUoySzioLHmM orfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0QQ25+fK; 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 c11si601059otf.91.2020.01.07.13.12.20; Tue, 07 Jan 2020 13:12:33 -0800 (PST) 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=pass header.i=@kernel.org header.s=default header.b=0QQ25+fK; 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 S1730001AbgAGVKl (ORCPT + 99 others); Tue, 7 Jan 2020 16:10:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:37594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727923AbgAGVKk (ORCPT ); Tue, 7 Jan 2020 16:10:40 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7AF224656; Tue, 7 Jan 2020 21:10:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578431439; bh=Dbl+ncwhMB3Xk8G2+tbpLHrwmr3/Xrw+XklCgJMWSjE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0QQ25+fKjT36C6nOJgMyVfthZnk5+MnAb1pPY+BZNA1H+bffB8uUO+L8/W7JN0hN3 SE73bWm/ZoIFXYhFJqh9Eq+jpqzYzHlG/xJaGsKvE3AlXx84iFE74xT49woud47ZsW 5dZlUxTgep+KBbXFo5QADG7W2+YM7okrYJjoy098= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , Stephan Gerhold , Mark Brown Subject: [PATCH 4.14 56/74] regulator: ab8500: Remove AB8505 USB regulator Date: Tue, 7 Jan 2020 21:55:21 +0100 Message-Id: <20200107205220.933688617@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200107205135.369001641@linuxfoundation.org> References: <20200107205135.369001641@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stephan Gerhold commit 99c4f70df3a6446c56ca817c2d0f9c12d85d4e7c upstream. The USB regulator was removed for AB8500 in commit 41a06aa738ad ("regulator: ab8500: Remove USB regulator"). It was then added for AB8505 in commit 547f384f33db ("regulator: ab8500: add support for ab8505"). However, there was never an entry added for it in ab8505_regulator_match. This causes all regulators after it to be initialized with the wrong device tree data, eventually leading to an out-of-bounds array read. Given that it is not used anywhere in the kernel, it seems likely that similar arguments against supporting it exist for AB8505 (it is controlled by hardware). Therefore, simply remove it like for AB8500 instead of adding an entry in ab8505_regulator_match. Fixes: 547f384f33db ("regulator: ab8500: add support for ab8505") Cc: Linus Walleij Signed-off-by: Stephan Gerhold Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20191106173125.14496-1-stephan@gerhold.net Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- drivers/regulator/ab8500.c | 17 ----------------- include/linux/regulator/ab8500.h | 1 - 2 files changed, 18 deletions(-) --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c @@ -1099,23 +1099,6 @@ static struct ab8500_regulator_info .update_val_idle = 0x82, .update_val_normal = 0x02, }, - [AB8505_LDO_USB] = { - .desc = { - .name = "LDO-USB", - .ops = &ab8500_regulator_mode_ops, - .type = REGULATOR_VOLTAGE, - .id = AB8505_LDO_USB, - .owner = THIS_MODULE, - .n_voltages = 1, - .volt_table = fixed_3300000_voltage, - }, - .update_bank = 0x03, - .update_reg = 0x82, - .update_mask = 0x03, - .update_val = 0x01, - .update_val_idle = 0x03, - .update_val_normal = 0x01, - }, [AB8505_LDO_AUDIO] = { .desc = { .name = "LDO-AUDIO", --- a/include/linux/regulator/ab8500.h +++ b/include/linux/regulator/ab8500.h @@ -38,7 +38,6 @@ enum ab8505_regulator_id { AB8505_LDO_AUX6, AB8505_LDO_INTCORE, AB8505_LDO_ADC, - AB8505_LDO_USB, AB8505_LDO_AUDIO, AB8505_LDO_ANAMIC1, AB8505_LDO_ANAMIC2,