]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
thunderbolt: Fix property read in nhi_wake_supported()
authorKonrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Mon, 9 Mar 2026 09:39:49 +0000 (10:39 +0100)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 9 Mar 2026 11:36:54 +0000 (12:36 +0100)
commit73a505dc48144ec72e25874e2b2a72487b02d3bc
tree3c24650bc4067e04e96e02eb5d5a9a793eb77293
parent1f318b96cc84d7c2ab792fcc0bfd42a7ca890681
thunderbolt: Fix property read in nhi_wake_supported()

device_property_read_foo() returns 0 on success and only then modifies
'val'. Currently, val is left uninitialized if the aforementioned
function returns non-zero, making nhi_wake_supported() return true
almost always (random != 0) if the property is not present in device
firmware.

Invert the check to make it make sense.

Fixes: 3cdb9446a117 ("thunderbolt: Add support for Intel Ice Lake")
Cc: stable@vger.kernel.org
Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/nhi.c