From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 884FFC4363C for ; Wed, 7 Oct 2020 18:44:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2649D2173E for ; Wed, 7 Oct 2020 18:44:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="WXlaV9pj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728092AbgJGSoJ (ORCPT ); Wed, 7 Oct 2020 14:44:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727033AbgJGSoI (ORCPT ); Wed, 7 Oct 2020 14:44:08 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4F8BC061755 for ; Wed, 7 Oct 2020 11:44:08 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id g29so1996181pgl.2 for ; Wed, 07 Oct 2020 11:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=X8jO+k78iPi+PQAecC0Q3ap/SytXosdxrChjraSoqaw=; b=WXlaV9pjXkhbYj7Tg3Q1c0hwqAynsaOgzckoDSnGldqENxpknhYFK+5HgLYSpow9GR FA1COQvpB8NLwrZ6HZ5yEyhxNDEVzPNlCrGNETZoLg/yTH6YMwVaZfS6Cd5ikwVO95aL lHiAXKSV918g2lozIMNiL3bie1lJw3NAvn3fM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=X8jO+k78iPi+PQAecC0Q3ap/SytXosdxrChjraSoqaw=; b=okQDSbAEhgHwiYpnyCBMLHziYkzTDdq/eCFOu65KezxBTxzaWTwttWzRV0qwrVhQvr 4GDdTUXpXODFihwlDRN6QwEyhb8WKBa1uiKwuPIaHrYagdDQBDuA3zB6/48s55xgPpHQ t3VLREv72DIrmpUkglLNKkdm+SvM5qrtQS6ZJegxGR+H8YURnJl0PkPYBqhs7gz8dFhB f9QHXgLf//JVAECm6gouuMUki+76Vlvpp+VffAP50DA1cz7kh1fAWeMxZfP3hbz82Wwk HoI9MTIsz3YhWM5J/ibYlH+opXzuVYmeRmXoF8WDyHyh+zPqTIXjIPSA4XkbSUvw2dpf OizA== X-Gm-Message-State: AOAM533U3yggRcSH8vXL8sZq1bjigGoBWSw0m7Ao/MB6du0YulWqI9Jq O4z/Yp9y2qrilOhoHxFnG5oU6Q== X-Google-Smtp-Source: ABdhPJxnc93bpj6O2XDgoB+4iJqQIaVqQaTINKkUrGuNUPDT7MwB5tqBz0QOGR7AhWiAKFDQbgzAJw== X-Received: by 2002:a05:6a00:d2:b029:152:5ebd:426 with SMTP id e18-20020a056a0000d2b02901525ebd0426mr4181620pfj.5.1602096248247; Wed, 07 Oct 2020 11:44:08 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id c9sm4014370pgl.92.2020.10.07.11.44.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Oct 2020 11:44:07 -0700 (PDT) Date: Wed, 7 Oct 2020 11:44:06 -0700 From: Kees Cook To: Sudip Mukherjee Cc: Luis Chamberlain , Iurii Zaikin , linux-kernel@vger.kernel.org, linux-safety@lists.elisa.tech, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2] kernel/sysctl.c: drop unneeded assignment in proc_do_large_bitmap() Message-ID: <202010071144.FA87F25D5D@keescook> References: <20201007151904.20415-1-sudipm.mukherjee@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201007151904.20415-1-sudipm.mukherjee@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 07, 2020 at 04:19:04PM +0100, Sudip Mukherjee wrote: > The variable 'first' is assigned 0 inside the while loop in the if block > but it is not used in the if block and is only used in the else block. > So, remove the unneeded assignment and move the variable in the else block. > > Signed-off-by: Sudip Mukherjee Reviewed-by: Kees Cook -- Kees Cook