Message ID | 20241209185429.54054-11-alejandro.lucero-palau@amd.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | cxl: add type2 device basic support | expand |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 5385349f0b8a..7ba31a222536 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -296,6 +296,8 @@ static inline unsigned long resource_ext_type(const struct resource *res) /* True iff r1 completely contains r2 */ static inline bool resource_contains(const struct resource *r1, const struct resource *r2) { + if (!resource_size(r1) || !resource_size(r2)) + return false; if (resource_type(r1) != resource_type(r2)) return false; if (r1->flags & IORESOURCE_UNSET || r2->flags & IORESOURCE_UNSET)