From: yury Date: Wed, 8 Nov 2006 08:44:25 +0000 (+0000) Subject: - fixed pssible NULL pointer access in lprocfs_rd_conn_uuid(); X-Git-Tag: v1_8_0_110~486^2~208 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7720aae23f4d53c68aea7a8f3390879775268c38;p=fs%2Flustre-release.git - fixed pssible NULL pointer access in lprocfs_rd_conn_uuid(); --- diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index c39f494..3c03070 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -359,12 +359,20 @@ int lprocfs_rd_conn_uuid(char *page, char **start, off_t off, int count, { struct obd_device *obd = (struct obd_device*)data; struct ptlrpc_connection *conn; + int rc; LASSERT(obd != NULL); - conn = obd->u.cli.cl_import->imp_connection; - LASSERT(conn != NULL); + *eof = 1; - return snprintf(page, count, "%s\n", conn->c_remote_uuid.uuid); + if (obd->u.cli.cl_import) { + conn = obd->u.cli.cl_import->imp_connection; + LASSERT(conn != NULL); + rc = snprintf(page, count, "%s\n", + conn->c_remote_uuid.uuid); + } else { + rc = snprintf(page, count, "%s\n", ""); + } + return rc; } static const char *obd_connect_names[] = {