Check if t is valid before accessing it. Signed-off-by: Wenchao Hao <haowenc...@huawei.com> Signed-off-by: Zhiqiang Liu <liuzhiqian...@huawei.com> Signed-off-by: Wu Bo <wub...@huawei.com> --- usr/iscsi_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c index 540adfd..abefde2 100644 --- a/usr/iscsi_sysfs.c +++ b/usr/iscsi_sysfs.c @@ -856,7 +856,7 @@ static int iscsi_sysfs_read_iface(struct iface_rec *iface, int host_no, } } - if (session && t->template->use_boot_info) + if (session && t && t->template->use_boot_info) iscsi_sysfs_read_boot(iface, session); if (!iface_kern_id) -- 2.27.0 -- You received this message because you are subscribed to the Google Groups "open-iscsi" group. To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/open-iscsi/20201207015410.48488-2-haowenchao%40huawei.com.