This patch fixes Dereference before null check reported
by coverity run.
CoverityID: 404751 ("Dereference before null")
Test-Parameters: trivial
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I89bcc820244ab17a60bf1d5c86f9d6a8747b43ed
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52903
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
static int obd_device_list_seq_show(struct seq_file *p, void *v)
{
struct obd_device *obd = v;
- int dev_no = obd->obd_minor;
char *status;
+ int dev_no;
if (!obd)
return 0;
LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC);
+ dev_no = obd->obd_minor;
if (obd->obd_stopping)
status = "ST";