[pnfs] [PATCH 06/10] pnfs: check for null pointers in print_ds_list
andros at netapp.com
andros at netapp.com
Wed May 7 16:53:41 EDT 2008
From: Andy Adamson <andros at umich.edu>
Signed-off-by: Andy Adamson<andros at netapp.com>
---
fs/nfs/nfs4filelayoutdev.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
index aee5425..4c7f4cd 100644
--- a/fs/nfs/nfs4filelayoutdev.c
+++ b/fs/nfs/nfs4filelayoutdev.c
@@ -70,12 +70,17 @@ print_ds_list(struct nfs4_pnfs_dev *fdev)
int i;
ds = fdev->ds_list[0];
+ if (ds == NULL) {
+ dprintk("%s NULL device \n", __func__);
+ return;
+ }
for (i = 0; i < fdev->num_ds; i++) {
dprintk(" ip_addr %x\n", ntohl(ds->ds_ip_addr));
dprintk(" port %hu\n", ntohs(ds->ds_port));
dprintk(" client %p\n", ds->ds_clp);
- dprintk(" cl_exchange_flags %x\n",
- ds->ds_clp->cl_exchange_flags);
+ if (ds->ds_clp)
+ dprintk(" cl_exchange_flags %x\n",
+ ds->ds_clp->cl_exchange_flags);
ds++;
}
}
--
1.5.4.1
More information about the pNFS
mailing list