]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: endpoint: pci-epf-vntb: Use array_index_nospec() on mws_size[] access
authorKoichiro Den <den@valinux.co.jp>
Mon, 5 Jan 2026 07:56:06 +0000 (16:56 +0900)
committerManivannan Sadhasivam <mani@kernel.org>
Tue, 24 Feb 2026 10:33:39 +0000 (16:03 +0530)
commit26cd5ca272a44031c4ff381928aa1b816829d18d
tree8e06a044c7d37aa66d0b8b2e98f73ec5faee5bd1
parentf457c18d7904b22f8b6a9c6475161810085c34c9
PCI: endpoint: pci-epf-vntb: Use array_index_nospec() on mws_size[] access

Follow common kernel idioms for indices derived from configfs attributes
and suppress Smatch warnings:

  epf_ntb_mw1_show() warn: potential spectre issue 'ntb->mws_size' [r]
  epf_ntb_mw1_store() warn: potential spectre issue 'ntb->mws_size' [w]

Also fix the error message for out-of-range MW indices and %lld format
for unsigned values.

Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260105075606.1253697-1-den@valinux.co.jp
drivers/pci/endpoint/functions/pci-epf-vntb.c