From aeea5a731abf24c244e179004e29e91a19ec80a9 Mon Sep 17 00:00:00 2001 From: adilger Date: Tue, 5 Mar 2002 23:51:16 +0000 Subject: [PATCH] Don't dereference conn if we don't have a connection. --- lustre/obdclass/genops.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 6acfa7a..64b6db4 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -64,10 +64,14 @@ void obd_cleanup_obdo_cache(void) /* map connection to client */ struct obd_client *gen_client(const struct obd_conn *conn) { - struct obd_device * obddev = conn->oc_dev; + struct obd_device * obddev; struct list_head * lh, * next; struct obd_client * cli; + if (!conn) + return NULL; + + obddev = conn->oc_dev; lh = next = &obddev->obd_gen_clients; while ((lh = lh->next) != &obddev->obd_gen_clients) { cli = list_entry(lh, struct obd_client, cli_chain); -- 1.8.3.1