laforge submitted this change.
dahdi-sysfs-chan: Fix potential NULL pointer deref
Sometimes it is useful to look at compiler warnings:
dahdi-sysfs-chan.c:384:17: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
And indeed, we could have de-referenced a NULL pointer here.
Change-Id: I4274e7a92ca6ee7e92c6adb713fb89ffe31b4c72
---
M drivers/dahdi/dahdi-sysfs-chan.c
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dahdi/dahdi-sysfs-chan.c b/drivers/dahdi/dahdi-sysfs-chan.c
index a91e6ed..8682ea3 100644
--- a/drivers/dahdi/dahdi-sysfs-chan.c
+++ b/drivers/dahdi/dahdi-sysfs-chan.c
@@ -381,10 +381,11 @@
return;
for (i = 0; i < ARRAY_SIZE(fixed_minors); i++) {
void *d = fixed_minors[i].dev;
- if (d && !IS_ERR(d))
+ if (d && !IS_ERR(d)) {
dahdi_dbg(DEVICES, "Removing fixed device file %s\n",
fixed_minors[i].name);
DEL_DAHDI_DEV(fixed_minors[i].minor);
+ }
}
}
To view, visit change 27912. To unsubscribe, or for help writing mail filters, visit settings.