From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DD4023370F for ; Sun, 26 Apr 2026 17:43:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777225427; cv=none; b=rQ0WjIs3c2JxP2x/vSWpG5kP1OTrJgeiZtcj0j8ODI6awJc6r19ByHP662QsGHIKLc0iBp4bf7DPZawDjQdFY2cyGMVZEWkkdyek755yMtpi4A3Sblpa31cxOBtI7RpvjNqxsEm2Zi8eCctw7Jq6SHB5N2HUfGPZaz+P9MZXZ0c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777225427; c=relaxed/simple; bh=o+2tQlNwafZZw54JzhYieeauP3zcVjDqxTkCRYEWQVY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BYnxMdJyNDWVGzp/p4Dg6tl/c8gTBw7Nmkk1GUiZonXMQY+ZCxeMZFKJcufLd3ebknXNeKviKd1xczAGxY4Gs2XlG7o5LE9ioaeiMAtsez2fZ3dUuoxeLLwG+5WF0NWfYCAuGaBX71biSamSxvibz2UuyTJFoPbxNJyye+i1GQg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SsLIADjm; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SsLIADjm" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-c76b994f7a8so3678205a12.3 for ; Sun, 26 Apr 2026 10:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777225426; x=1777830226; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o+2tQlNwafZZw54JzhYieeauP3zcVjDqxTkCRYEWQVY=; b=SsLIADjmXieyi5SyeyDB8KCWysBp+uQYMF2GblSH4acnEu96ArjgXcMXX/q0DYp1lB DGs0hl4ko0rS5pKmFXVMcGDJ6ghBM92mzAiGg84k7+uYLyhXckYOSaucRWAouV/WYNDr rHBVP3/Ye+scKTZunetIh97+gIwpPIgX+f87L+9wRSJEaAAeN9M1KB9LWu7rhxQEEEsj RFAELWumtQumuL2DW321vHMhCqj4AxWachf+oUwXPW2dZPyqs5zvoyaqOXnWl+dCccvw u+OeZ2bizv80/A6L/ofDIU0R2WG9WxlajO5h2pTQKnADzgHpWYd+L0OSKQwyKIgK6yMF Hnng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777225426; x=1777830226; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=o+2tQlNwafZZw54JzhYieeauP3zcVjDqxTkCRYEWQVY=; b=T0OeCSsFCzeJ12BulZ4a/FS7DlXlhrgfp9MhPOstLBXYKsophRpUsaG0aKNQdc1hJR Fx1QnDNqzsNlO007XNBaQtnG4Eqk5RTtrzBoUiBgJvIzBF4e7H7JkAIsrEhLsHV6g2mg C+qQ+jZf29aEnA6TO46MgdRv7XOGyZy3UagY5CpluslszjQuYasXTFxbD4we2ng79TYX sxiiZT3tg13/T28Im7LwJK16uQi544/jjqluqNLXlSNbbK7Na8evHcwpDtJBhKOCvS+z WM2mEzBH0i5U+3qzcuLPbTI4/0dXUgRNWmWRwADu2X0NXGcR21WsfdvEM65yia/f1w9m baCA== X-Forwarded-Encrypted: i=1; AFNElJ9gfDD4bpJroCw07hRhI9eiuVOnmJGZe8MU4rORbYtodafztdT52vH9PDuTrCkNLztvlFqB41C2KYss0u4=@vger.kernel.org X-Gm-Message-State: AOJu0YzCHuN/Vx5Ib4nwHLkVWVLet9cWiMIcp3yqllxXCAzZ96w16naz meucqIThGjp1AZeWY1np6mPXR6jxFUrBgOg5GJthUQxNlH4FICvT5eKA X-Gm-Gg: AeBDieulr+OaF+VkVp2StFnmlsLhesGMXeyc9xKVc8hJBEFc2HoNab1D4gN1oxNZMFa AOhar/wTQmGl332aYLooD+W5TDhgeL6QL7Be0YEAHHyCIEoXLdzPJtNK0+IT0Yu4HCdhSnm4oOM s07OXrpB7VYXi/fWNdZhITxqQbbZkXtGcsNNYXQqHPuL7AdQIXK33W7p2HFg2at4tleW2lURlzg PsOCmTPz4ctGwB3LW+bNI+Qlh52EDST3owShv3E7E2zdnHjvVtehRJqthSCZp+hvN9wdeG1wVjL K5XKsoYuRhxlcEFBOF3j91w0nylGSPEKghfVF4GRY3OetCQv5NXQEsYGx9VNx1r5EbnJqTkeWue JmeliUFQ0bfN6GaxZdSd2FbkR86ACyeYVUSqPnDS+Kxaw3m+P4jnHc/6TR5v+kDnbknKUAJg1CJ NyFmIiEH1VbK2QBP8EqILV6G6gha7RT8b0LadXZHu0WfJbzDY= X-Received: by 2002:a17:902:7293:b0:2b2:ebed:7af5 with SMTP id d9443c01a7336-2b5f9efd501mr270575985ad.13.1777225425876; Sun, 26 Apr 2026 10:43:45 -0700 (PDT) Received: from LAPTOP-DV5I1MV.localdomain ([27.19.123.93]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b5faa30047sm289920375ad.28.2026.04.26.10.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2026 10:43:45 -0700 (PDT) From: Yufei CHENG To: mpearson-lenovo@squebb.ca, derekjohn.clark@gmail.com, i@rong.moe Cc: hansg@kernel.org, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] platform/x86: lenovo: wmi-other: Fix uninitialized Date: Mon, 27 Apr 2026 01:43:32 +0800 Message-ID: <20260426174332.9981-1-cd345al@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <673b66893c16ca31b403e7e7cba32e9b71a7515a.camel@rong.moe> References: <673b66893c16ca31b403e7e7cba32e9b71a7515a.camel@rong.moe> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi Rong, Thanks for your feedback, I've corrected the format and resend the patch. However I think I have to point out some other issues in this file. First, we should not complexify simple things. You use lwmi_om_fan_get_set() to combine get and set into a single function with a boolean flag to determine the action. This makes the control flow harder to follow and audit. Furthermore, this layer of abstraction is not applied constantly throughout the whole file. In some places, values are set through lwmi_om_fan_get_set() and in other places, they're called manually through lwmi_dev_evaluate_int() This inconsistency makes the abstraction pointless and is the direct cause of a second uninitialized bug In line 855, args.arg0 is set to attribute_id, but arg1 is never set. Though arg1 is omitted in read action, you're still passing stack garbage to the lwmi_dev_evaluate_int(). And I think it's better to zero it out if not used. Additionally, I doubt whether bypassing the minimum RPM divisor has any practical use at all, not to mention it's not guranteed to work and purely depends on whether EC accepts that sub-division value. I may do some refactor recently, and I'm happy to hear your suggestions. Thanks, Yufei