Message ID | 20171127104854.333-4-brgl@bgdev.pl |
---|---|
State | New |
Headers | show
Return-Path: <linux-gpio-owner@vger.kernel.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bgdev-pl.20150623.gappssmtp.com header.i=@bgdev-pl.20150623.gappssmtp.com header.b="ha7VYKx+"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3ylkNr33RBz9rxl for <incoming@patchwork.ozlabs.org>; Mon, 27 Nov 2017 22:00:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752374AbdK0LAm (ORCPT <rfc822;incoming@patchwork.ozlabs.org>); Mon, 27 Nov 2017 06:00:42 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:46028 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752292AbdK0KtM (ORCPT <rfc822; linux-gpio@vger.kernel.org>); Mon, 27 Nov 2017 05:49:12 -0500 Received: by mail-wr0-f195.google.com with SMTP id a63so25905178wrc.12 for <linux-gpio@vger.kernel.org>; Mon, 27 Nov 2017 02:49:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=y1vyqEmyevhQFXaBXGs4ukyCBwCueVdK2XuNnaXymKM=; b=ha7VYKx+TyqOuphATLF8lNDRuMzux3FvYm0U99FqMM3VBgc1GDaQ4ZQjCqtOZdNbSG tiyyjhLcF12ScvrIlMu+YAcHIbtgttI9tKt6drU0K5PqyDwhM+rXcXCNN+LGQxSJAyJ/ Jv56lDUbxOOH+JeSxfGjaShnowEq9K+l12jTFTzSP9t1SPUHd09KCLCTdmToMt+EVBe/ U6yauoKRYOWiXZpBrVAFCGEQ2LocHBfuYQuI5cKXDHbSIu/CDeF2IYOz+igQnophLwkf EinTno9P91k93sHEI+7GLytfN+B2YnhA2JJjTNHCnfDvWBOqByHBkmo+AIaa9uAsg0I5 2rrQ== 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:in-reply-to :references; bh=y1vyqEmyevhQFXaBXGs4ukyCBwCueVdK2XuNnaXymKM=; b=t1xSVIeZfKPz79IFRVUYH6s17RVCACOgfTh79Ux0RNGpKedzvXM2rObYTgfCPyvFU0 GrvvBAJfrVCCLrFMnGzEidyGarJszDN6xjhcEAJyPJ9OWF6/dtxWKIYWOixuS++1/ISf 1Hn/EIuOdq8lpsDTBGdHMODU7eIaf1a8l2i3C0sMfqeJEVWtFgozk7sFsjEU1OOz6CdX W46XqubCHQCwQYRQE8HCSiEAKYju0QK+xLi6ocprbDTRnW06ktb2fEOHFs1i4N9RxTo8 5IEpD4ZWElZtHMeHz1zEq6/tmIDM8TWVHvwh55dQTUKVnCorI7oM/99GkLIu0WPEnnTx 7ZZg== X-Gm-Message-State: AJaThX6jW1gWeY9mOqj3+rkwjuqbiKgGZKt91XlHCQJI6rsXRiR76dEM oVoT4SIfVdFARpDn6it980tYvw== X-Google-Smtp-Source: AGs4zMa13bdYwawt+CLj20ei+US9Q6VxrWGf5lFlx2KB/EUGw1OnPNBjt/lLocXO7jcsmxOkt+9nCQ== X-Received: by 10.223.163.11 with SMTP id c11mr25526501wrb.214.1511779751655; Mon, 27 Nov 2017 02:49:11 -0800 (PST) Received: from bgdev-debian.local ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id 68sm21071741wmh.2.2017.11.27.02.49.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 02:49:11 -0800 (PST) From: Bartosz Golaszewski <brgl@bgdev.pl> To: Linus Walleij <linus.walleij@linaro.org>, Bamvor Jian Zhang <bamvor.zhangjian@linaro.org> Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski <brgl@bgdev.pl> Subject: [PATCH 03/18] gpio: mockup: verify the number of GPIO chips requested Date: Mon, 27 Nov 2017 11:48:39 +0100 Message-Id: <20171127104854.333-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171127104854.333-1-brgl@bgdev.pl> References: <20171127104854.333-1-brgl@bgdev.pl> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: <linux-gpio.vger.kernel.org> X-Mailing-List: linux-gpio@vger.kernel.org |
Series |
gpio: mockup: updates for v4.16
|
expand
|
diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c index b70f3b0c30b1..0a269cbe197c 100644 --- a/drivers/gpio/gpio-mockup.c +++ b/drivers/gpio/gpio-mockup.c @@ -330,7 +330,9 @@ static int __init gpio_mockup_init(void) { int err; - if (gpio_mockup_params_nr < 2 || (gpio_mockup_params_nr % 2)) + if ((gpio_mockup_params_nr < 2) || + (gpio_mockup_params_nr % 2) || + (gpio_mockup_params_nr > GPIO_MOCKUP_MAX_RANGES)) return -EINVAL; gpio_mockup_dbg_dir = debugfs_create_dir("gpio-mockup-event", NULL);
The number of supported mockup chips is limited. Check this limit when parsing the module parameters. Also: make sure that each chip is described with a <base - ngpio> pair. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> --- drivers/gpio/gpio-mockup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)