John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43553 )
Change subject: superio/common: Avoid NULL pointer dereference ......................................................................
superio/common: Avoid NULL pointer dereference
Coverity detects dereferencing a pointer that might be "NULL" when calling report_resource_stored. Add sanity check for dev to prevent NULL pointer dereference.
Found-by: Coverity CID 1419488
Signed-off-by: John Zhao john.zhao@intel.com Change-Id: I03efad87ba761e914b47e3294c646335cfbaed24 --- M src/superio/common/generic.c 1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/53/43553/1
diff --git a/src/superio/common/generic.c b/src/superio/common/generic.c index 096b96d..83f2fea 100644 --- a/src/superio/common/generic.c +++ b/src/superio/common/generic.c @@ -9,6 +9,9 @@ { struct resource *res;
+ if (!dev) + return; + if (dev->link_list) assign_resources(dev->link_list);
Felix Held has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43553 )
Change subject: superio/common: Avoid NULL pointer dereference ......................................................................
Patch Set 1: Code-Review+2
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43553 )
Change subject: superio/common: Avoid NULL pointer dereference ......................................................................
Patch Set 1: Code-Review+2
Thanks for all of these Coverity cleanups John!
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43553 )
Change subject: superio/common: Avoid NULL pointer dereference ......................................................................
Patch Set 1: Code-Review+2
Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/43553 )
Change subject: superio/common: Avoid NULL pointer dereference ......................................................................
superio/common: Avoid NULL pointer dereference
Coverity detects dereferencing a pointer that might be "NULL" when calling report_resource_stored. Add sanity check for dev to prevent NULL pointer dereference.
Found-by: Coverity CID 1419488
Signed-off-by: John Zhao john.zhao@intel.com Change-Id: I03efad87ba761e914b47e3294c646335cfbaed24 Reviewed-on: https://review.coreboot.org/c/coreboot/+/43553 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Felix Held felix-coreboot@felixheld.de Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M src/superio/common/generic.c 1 file changed, 3 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Felix Held: Looks good to me, approved Angel Pons: Looks good to me, approved Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/superio/common/generic.c b/src/superio/common/generic.c index 096b96d..83f2fea 100644 --- a/src/superio/common/generic.c +++ b/src/superio/common/generic.c @@ -9,6 +9,9 @@ { struct resource *res;
+ if (!dev) + return; + if (dev->link_list) assign_resources(dev->link_list);