Whamcloud - gitweb
Don't dereference conn if we don't have a connection.
authoradilger <adilger>
Tue, 5 Mar 2002 23:51:16 +0000 (23:51 +0000)
committeradilger <adilger>
Tue, 5 Mar 2002 23:51:16 +0000 (23:51 +0000)
lustre/obdclass/genops.c

index 6acfa7a..64b6db4 100644 (file)
@@ -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);