]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
PCI: Fix use of uninitialized MPS value
authorBjorn Helgaas <bhelgaas@google.com>
Tue, 29 Apr 2014 18:51:55 +0000 (12:51 -0600)
committermobile promotions <svcmobile_promotions@nvidia.com>
Wed, 23 Sep 2015 15:30:15 +0000 (08:30 -0700)
commitdfc76a7e9d62465948bd51c0439ae61016a8f310
treec0b7f7f53ba13f0a4bfc8cbed3e88080908e9c67
parente5dd25d322ebff4bdf2826102a63ee371777d04b
PCI: Fix use of uninitialized MPS value

If "pcie_bus_config == PCIE_BUS_PERFORMANCE", we don't initialize "smpss",
so we pass a pointer to garbage into pcie_bus_configure_set(), where we
compute "mps" based on the garbage.  We then pass the garbage "mps" to
pcie_write_mps(), which ignores it in the PCIE_BUS_PERFORMANCE case.

Coverity isn't smart enough to deduce that we ignore the garbage (it's a
lot to expect from a human, too), so initialize "smpss" to a safe value in
all cases.

Cherry-picked from vanilla kernel commit ID 1e358f94c0

Coverity ID 13477

Bug 200083369

Change-Id: I33131de68a8e47d65e9ae1a01a931cb76116a886
Signed-off-by: Pavitrakumar <pavitrak@nvidia.com>
Reviewed-on: http://git-master/r/759248
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
drivers/pci/probe.c