diff options
author | Nico Huber <nico.huber@secunet.com> | 2020-10-12 16:25:40 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2020-11-16 12:15:38 +0000 |
commit | 7e3e1ea43f6de16b3369e9bca8374bc956dfb0bf (patch) | |
tree | ceeb1f38b849c980e8938d24ed3c518ceb947d21 /src/security/lockdown | |
parent | d3d0fd7d5e34128054210e257de24f7a954573f6 (diff) |
device/pci: Add NULL check for PCI driver's .ops
Add a NULL check and only skip setting the default operations
if `.ops` was set by a driver. It's fairly unlikely that some-
body adds a driver and forgets the `.ops` pointer. So this is
mostly to increase readability: Nobody should have to wonder
if we're missing a NULL-check.
The condition is moved out of the loop to reduce indentation
levels. Alternatively, we could jusk skip drivers that don't
have `.ops` set (i.e. continue the loop).
Change-Id: I5dcc05ebb092fb9c4be929c81ea2b05a10b1311b
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46297
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/security/lockdown')
0 files changed, 0 insertions, 0 deletions