In function rtalloc_mpath(), do not try to release the lock if the ro_rt

pointer is NULL.

Reported by:	(pluknet at gmail dot com)
This commit is contained in:
Qing Li 2008-04-24 05:04:52 +00:00
parent 41a05be4ea
commit a975973d8b

View File

@ -269,7 +269,9 @@ rtalloc_mpath(struct route *ro, int hash)
ro->ro_rt = rtalloc1(&ro->ro_dst, 1, 0UL);
/* if the route does not exist or it is not multipath, don't care */
if (!ro->ro_rt || !rn_mpath_next((struct radix_node *)ro->ro_rt)) {
if (ro->ro_rt == NULL)
return;
if (rn_mpath_next((struct radix_node *)ro->ro_rt) == NULL) {
RT_UNLOCK(ro->ro_rt);
return;
}