summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorBill Pemberton2012-10-09 20:18:19 +0200
committerGreg Kroah-Hartman2012-10-17 23:10:10 +0200
commitd7c4660c12adc5c66351253af381259686fa08a4 (patch)
tree62743423b33605d87076851693cf1143c89a3ba6 /drivers/staging
parentMerge tag 'disintegrate-tty-20121009' of git://git.infradead.org/users/dhowel... (diff)
downloadkernel-qcow2-linux-d7c4660c12adc5c66351253af381259686fa08a4.tar.gz
kernel-qcow2-linux-d7c4660c12adc5c66351253af381259686fa08a4.tar.xz
kernel-qcow2-linux-d7c4660c12adc5c66351253af381259686fa08a4.zip
staging: dgrp: check for NULL pointer in (un)register_proc_table
register_proc_table and unregister_proc_table didn't deal with the possibility that the *table pointer could be NULL. Check for this and return if table is NULL. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/dgrp/dgrp_specproc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/staging/dgrp/dgrp_specproc.c b/drivers/staging/dgrp/dgrp_specproc.c
index a5840e7d6665..24327c3bad83 100644
--- a/drivers/staging/dgrp/dgrp_specproc.c
+++ b/drivers/staging/dgrp/dgrp_specproc.c
@@ -229,6 +229,9 @@ static void register_proc_table(struct dgrp_proc_entry *table,
int len;
mode_t mode;
+ if (table == NULL)
+ return;
+
for (; table->id; table++) {
/* Can't do anything without a proc name. */
if (!table->name)
@@ -297,6 +300,9 @@ static void unregister_proc_table(struct dgrp_proc_entry *table,
struct proc_dir_entry *de;
struct nd_struct *tmp;
+ if (table == NULL)
+ return;
+
list_for_each_entry(tmp, &nd_struct_list, list) {
if ((table == dgrp_net_table) && (tmp->nd_net_de)) {
unregister_dgrp_device(tmp->nd_net_de);