From: adilger Date: Tue, 5 Mar 2002 23:51:16 +0000 (+0000) Subject: Don't dereference conn if we don't have a connection. X-Git-Tag: 0.4.2~559 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=aeea5a731abf24c244e179004e29e91a19ec80a9;p=fs%2Flustre-release.git Don't dereference conn if we don't have a connection. --- 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);