qsd_init() might return NULL in some cases, which is not correct and
may make kernel crash. This patch fixes this problem.
Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: I604077f2f9143e500badb5148a6f0d9a246e375f
Reviewed-on: http://review.whamcloud.com/7100
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
/* only configure qsd for MDT & OST */
type = server_name2index(svname, &idx, NULL);
if (type != LDD_F_SV_TYPE_MDT && type != LDD_F_SV_TYPE_OST)
/* only configure qsd for MDT & OST */
type = server_name2index(svname, &idx, NULL);
if (type != LDD_F_SV_TYPE_MDT && type != LDD_F_SV_TYPE_OST)
+ RETURN(ERR_PTR(-EINVAL));
/* allocate qsd instance */
OBD_ALLOC_PTR(qsd);
/* allocate qsd instance */
OBD_ALLOC_PTR(qsd);