Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4287546rwb; Mon, 21 Nov 2022 06:04:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf721Rta14OSTc27iUQ5fzZxaHL5yVdRI+/37OFJ5f7/cFsf8Puva6OBmA9ahiBtBi0OO/sv X-Received: by 2002:a17:90a:ac07:b0:206:238e:1379 with SMTP id o7-20020a17090aac0700b00206238e1379mr20279602pjq.180.1669039492066; Mon, 21 Nov 2022 06:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669039492; cv=none; d=google.com; s=arc-20160816; b=imF3/aZlaUutwgjZSSgAb63XZdvf89g9e0LhY/9ckUznHB6Z1k/l22Qf9gPZsMzQOu BpJ7mtV2mDP0+R8dtI5l35ZweuEMVHnOd8ODZgdCq4OoMEGizVSlpL3semH6ArFhTGWL hA0YcRki9DUNj2bXlxay3djHHJFk1fcMRSwCKlONcLdScW3J0fsD27cXffNyF0HcOBRb RQgWtScYbS0eOgPu1opmX59B9xixfT7gV4RReqiIxRC4V9QgTQTr8sFQREwmaZeHJD7P vvJipkmPWozfuxDPTCmu6eu/IFN+2tOMXA0VG1NbrumDrKLM8uizLGE1VnKBK2DcsFQI ZmQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=7fsoSstP+kTMnlGCyhKQpRZRy1Cn2GgHrvraYINr6P0=; b=J857fY307VaXoOCpU+i44aBvRIz/fcUEzgzZDt3NIXm1qZUm44UEBejw5eavWnp4PU 4K8d9rmbW1BVu0Q1QoCOicWPh3IjUDyL2cS7mTOLTVeEHCH9GM9SoIhij3VVMe/4TTjK NuwbXohiR3g80dBokQKjp+JC+KWixihKiYTr7XUcFghZf87xu+4PDJngR4frisCRrwmt mLiJeMIvSyy3SN3F5YRFjJAU86FOKRm0805nXZv6KYqid68ZvtT+T1B2zGmqcsv4qp2P pqRWu2oA89ot2+KxArGRQiJ0ZMP4VakRAN6uLiaqA2POnyN5F7d3dEuu8ITvLH8xoANF Q+Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tLc3HmTv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k31-20020a634b5f000000b004708e8db2b4si11772312pgl.796.2022.11.21.06.04.28; Mon, 21 Nov 2022 06:04:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tLc3HmTv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231428AbiKUNnY (ORCPT + 92 others); Mon, 21 Nov 2022 08:43:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231425AbiKUNnI (ORCPT ); Mon, 21 Nov 2022 08:43:08 -0500 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BF9BC1F71 for ; Mon, 21 Nov 2022 05:42:43 -0800 (PST) Received: by mail-yb1-xb33.google.com with SMTP id 205so13593531ybe.7 for ; Mon, 21 Nov 2022 05:42:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7fsoSstP+kTMnlGCyhKQpRZRy1Cn2GgHrvraYINr6P0=; b=tLc3HmTvsLWQ82lR6B6iR76sR+Rdyf6gUKpUNsZ4d59KxO6FQLRT9iCtd+a7WXb/Kv WxIy74c5i6veiZgMD1pSc7PMCo81tbqvtigJWx+oeTbCTVMgkCJtnB4IVQWgXi8c4dYV doqWeCsxIsTxu8Gg/k4eOLy9THzp+WH4k9RifTHJeQCYHlnqAucBFaPIG0r8dcNlR1NE wYwtslCMbW//KKggTSyDwe5TWzUhJ/1BrVdA3bg9o4czJ3x24VM4Mm3Xe3HEftKb6Jz9 Na4BT06OHWdus37ULNZ1BQ7JoySXCk3w0OAoPqyMtruwirxUhZ2fiv7Fj7XfrsRItaJZ unrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7fsoSstP+kTMnlGCyhKQpRZRy1Cn2GgHrvraYINr6P0=; b=X19PMHRoFkfFeg0MrmzjMUKw8EoGmErhpA/uEhAvzJJPqHgeoRTo8ZyRI0Mv6pKuIX qpMwxK9p6ZwMQ37zXL2tMo4/bRYH7bMSXhyyKJYyMnHY5p/spaPjwovbMqmN1OAGWkyE PifkYzK4pHhAfRsuBXRDGCO9utKXe7ERbwD2mdgtq/FTZj/0VXUXWTZzuky3hAgp8XJM mPwgZKHx2TeuSoKd9CMSSpLhstgdAjkWZs0m4RzTD7bReKzKfAakVJtKRuFU3IdxlqzU bMB3D51ESuSSNC7mwiQWcYjtDVu1aZXtrdCg5Xef+ExOS5Q/Ilw5ttx4aY3vurqu9NEB plkw== X-Gm-Message-State: ANoB5plj/ubbhbmP9H9Ou8zif6esET/FKRnOizqKcd42uAalb7ev3Jsd xBdEnx5AWFEymcT8MG6YGhGP1YX4yPx8A4QZdcEapQ== X-Received: by 2002:a25:acd1:0:b0:6b4:b9e3:c64b with SMTP id x17-20020a25acd1000000b006b4b9e3c64bmr17664071ybd.238.1669038162430; Mon, 21 Nov 2022 05:42:42 -0800 (PST) MIME-Version: 1.0 References: <20221117123034.27383-1-korotkov.maxim.s@gmail.com> In-Reply-To: <20221117123034.27383-1-korotkov.maxim.s@gmail.com> From: Linus Walleij Date: Mon, 21 Nov 2022 14:42:31 +0100 Message-ID: Subject: Re: [PATCH] pinctrl: single: Fix potential division by zero To: Maxim Korotkov Cc: Tony Lindgren , Haojian Zhuang , "Manjunathappa, Prakash" , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2022 at 1:32 PM Maxim Korotkov wrote: > There is a possibility of dividing by zero due to the pcs->bits_per_pin > if pcs->fmask() also has a value of zero and called fls > from asm-generic/bitops/builtin-fls.h or arch/x86/include/asm/bitops.h. > The function pcs_probe() has the branch that assigned to fmask 0 before > pcs_allocate_pin_table() was called > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure multiple pins of different modules") > Signed-off-by: Maxim Korotkov Patch applied for fixes. Yours, Linus Walleij