aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/dgrp
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2013-01-22 03:38:17 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-22 08:58:44 -0800
commit7b63c5772fd6eea71b1332570812297e45403126 (patch)
treee6470434c08799c1c17fc3e72a1060b2afea99e3 /drivers/staging/dgrp
parentb194218dba531b9c36080d29d10fdf9ef96a15bf (diff)
downloadkernel_goldelico_gta04-7b63c5772fd6eea71b1332570812297e45403126.zip
kernel_goldelico_gta04-7b63c5772fd6eea71b1332570812297e45403126.tar.gz
kernel_goldelico_gta04-7b63c5772fd6eea71b1332570812297e45403126.tar.bz2
staging: dgrp: check for a valid proc dir entry pointer
while proc_create fails, the register_proc_table can do a derefernce of the null pointer causing to oops the system, instead check for a valid pointer at register and unregister Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgrp')
-rw-r--r--drivers/staging/dgrp/dgrp_specproc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/dgrp/dgrp_specproc.c b/drivers/staging/dgrp/dgrp_specproc.c
index c214078..e09fc9c 100644
--- a/drivers/staging/dgrp/dgrp_specproc.c
+++ b/drivers/staging/dgrp/dgrp_specproc.c
@@ -181,13 +181,13 @@ static struct dgrp_proc_entry dgrp_dpa_table[] = {
void dgrp_unregister_proc(void)
{
- unregister_proc_table(dgrp_table, dgrp_proc_dir_entry);
net_entry_pointer = NULL;
mon_entry_pointer = NULL;
dpa_entry_pointer = NULL;
ports_entry_pointer = NULL;
if (dgrp_proc_dir_entry) {
+ unregister_proc_table(dgrp_table, dgrp_proc_dir_entry);
remove_proc_entry(dgrp_proc_dir_entry->name,
dgrp_proc_dir_entry->parent);
dgrp_proc_dir_entry = NULL;
@@ -231,6 +231,8 @@ static void register_proc_table(struct dgrp_proc_entry *table,
if (table == NULL)
return;
+ if (root == NULL)
+ return;
for (; table->id; table++) {
/* Can't do anything without a proc name. */