Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3838613ybg; Sun, 20 Oct 2019 22:56:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0PWC9MYKpJJXhd3NN3JbcXKahvaz1zeSsV7TFmSx0R9wJiXI243pqKkFz7OnkwB+L/Xus X-Received: by 2002:a17:906:c82e:: with SMTP id dd14mr11354350ejb.310.1571637408978; Sun, 20 Oct 2019 22:56:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571637408; cv=none; d=google.com; s=arc-20160816; b=CIbyzMGa9/DxKyzQHl1WwQWFha5csKu86bqNXDky8wMaJsydMogSG0JRm+hBiziJYD 98vb7gCt96Mtwwf2G7vaslbqTNkMh+O1lOlJZd39IVjWb9mRElLXD0arKyJCOa1XUvc5 1KhbhA3IHidGyNforBwMf/nfxPuPW40qHqfIYLXFxRZvG80xpo9zO7QKVLG2/S3W8J8c d75PDLnGR+POj9YTZ7PuEcC/Quo5Pfxsyt05jR8wPKJBTsp1frwv1asi480w1AekckiP aHbJjPshW2AJuSFm18F5y2V66TYP1u/U4WsPAQcHxnx2qVMVZO3VQhaGXEvBY8px++Qt vUog== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8emxxlyv0hfOTgOOWBUsQUpOlmvH2jBaXtEtprCbnfQ=; b=ynSJv+27MuEU/yNz03NvLyiTmUTtvninnieNojfwxqIoyYJVWuIg49LSVootUZfYXp wb7wET5Lp28hVv4S/IIhZfmyJzOeH/R90IfXVn6aud/l7jY5BxJOKLb49zlVE1f9w5lw FuMse2l02jWX/pceGD8XLL6Geo64NfJ1NPUNEmDqHy44hIILoQeg3bCzwXhfz7PCcsBU dPHAnSx5o9bI+tUjH8cvL6Av3yxG9Wtmog5VfInOmM4wSmN71Xhy3bHhfBJQyrNovDs9 6Q8UTgg3CpxQ1H6zg4pZc4E7t6stv5Z7YmSTT/uhvhoWhq+aLevzvJwh4/aJbtXU8Y8a HjXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QEsYal5I; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s46si1212318edd.336.2019.10.20.22.56.26; Sun, 20 Oct 2019 22:56:48 -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; dkim=pass header.i=@chromium.org header.s=google header.b=QEsYal5I; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727460AbfJUFzM (ORCPT + 99 others); Mon, 21 Oct 2019 01:55:12 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46819 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727261AbfJUFyW (ORCPT ); Mon, 21 Oct 2019 01:54:22 -0400 Received: by mail-pf1-f195.google.com with SMTP id q5so7681203pfg.13 for ; Sun, 20 Oct 2019 22:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8emxxlyv0hfOTgOOWBUsQUpOlmvH2jBaXtEtprCbnfQ=; b=QEsYal5IjLMhnSvwqYnWTC1cGImeuZg5zYsuCBeORCFFYfeGHipQQiEWg6jKzClb+c MZTu3m9mT3MSVcuS3NJY3HI/kgL7aEOc1iuYar+t5pWRxe/9Pu75j56hWm6IhNHaFqAV E+g8aQdvYFktGh2uoqA/QpTmX9bA8cd0mR3Zg= 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:mime-version:content-transfer-encoding; bh=8emxxlyv0hfOTgOOWBUsQUpOlmvH2jBaXtEtprCbnfQ=; b=LgKHPQAJHV65xAdcbBx569UBqh/Tjuz0+jEphxVE364lB6yR0cBd3TbrhOxm68DKEK NqPUznkKXYZxZZGqxkzJzf0/4pwmv0Jbq5ZSfOGNkah/BJSs7SToxO1d3oQo9sBdRjF/ p3bRHZPW1z3IvTN8zSWM/erNTvVkcW8vtDteTPcWNPi8f1cLeSQxDYQXrelryXPgz9Ke 4l7xav2VdddRNneGFJW8Cph3ag26NZrY7enz+GWpMswID3YFAJKnsUQCvXbbdwVskykY bd7tET3lreMJsMpKpZv3dRzCCqW3WILjZxqZfxDoYKXjv99IthtB9hgzlUBU+VpWB1Ya nhWA== X-Gm-Message-State: APjAAAUVygguCWnspUesK5aBj4YAfjAC5Ix15EL8C8ZYD2pfCQX44DhQ FNra30YFNjFtSbY3FQkWAMENRg== X-Received: by 2002:a65:5541:: with SMTP id t1mr23450120pgr.39.1571637261616; Sun, 20 Oct 2019 22:54:21 -0700 (PDT) Received: from localhost ([2620:15c:202:1:3c8f:512b:3522:dfaf]) by smtp.gmail.com with ESMTPSA id l62sm15062699pfl.167.2019.10.20.22.54.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Oct 2019 22:54:21 -0700 (PDT) From: Gwendal Grignou To: briannorris@chromium.org, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, lee.jones@linaro.org, bleung@chromium.org, enric.balletbo@collabora.com, dianders@chromium.org, groeck@chromium.org, fabien.lahoudere@collabora.com Cc: linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, Enrico Granata , Gwendal Grignou Subject: [PATCH v2 06/18] platform: chrome: cros_ec: Do not attempt to register a non-positive IRQ number Date: Sun, 20 Oct 2019 22:53:51 -0700 Message-Id: <20191021055403.67849-7-gwendal@chromium.org> X-Mailer: git-send-email 2.23.0.866.gb869b98d4c-goog In-Reply-To: <20191021055403.67849-1-gwendal@chromium.org> References: <20191021055403.67849-1-gwendal@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Enrico Granata Add a layer of sanity checking to cros_ec_register against attempting to register IRQ values that are not strictly greater than 0. Signed-off-by: Enrico Granata Signed-off-by: Gwendal Grignou --- Changes in v2: Remove dual Enrico's signature. drivers/platform/chrome/cros_ec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c index 739f3cffe26e3..9b19f50572313 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -149,7 +149,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev) return err; } - if (ec_dev->irq) { + if (ec_dev->irq > 0) { err = devm_request_threaded_irq( dev, ec_dev->irq, ec_irq_handler, ec_irq_thread, IRQF_TRIGGER_LOW | IRQF_ONESHOT, -- 2.23.0.866.gb869b98d4c-goog