Marvell Wifi driver: NULL check before dereferencing
CID 5911.
This commit is contained in:
@@ -1451,15 +1451,20 @@ mwl_hal_bastream_alloc(struct mwl_hal_vap *vap, int ba_policy,
|
|||||||
}
|
}
|
||||||
sp = &mh->mh_streams[s];
|
sp = &mh->mh_streams[s];
|
||||||
mh->mh_bastreams &= ~(1<<s);
|
mh->mh_bastreams &= ~(1<<s);
|
||||||
sp->public.data[0] = a1;
|
if (sp != NULL) {
|
||||||
sp->public.data[1] = a2;
|
sp->public.data[0] = a1;
|
||||||
IEEE80211_ADDR_COPY(sp->macaddr, Macaddr);
|
sp->public.data[1] = a2;
|
||||||
sp->tid = Tid;
|
IEEE80211_ADDR_COPY(sp->macaddr, Macaddr);
|
||||||
sp->paraminfo = ParamInfo;
|
sp->tid = Tid;
|
||||||
sp->setup = 0;
|
sp->paraminfo = ParamInfo;
|
||||||
sp->ba_policy = ba_policy;
|
sp->setup = 0;
|
||||||
MWL_HAL_UNLOCK(mh);
|
sp->ba_policy = ba_policy;
|
||||||
return sp != NULL ? &sp->public : NULL;
|
MWL_HAL_UNLOCK(mh);
|
||||||
|
return &sp->public;
|
||||||
|
} else {
|
||||||
|
MWL_HAL_UNLOCK(mh);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const MWL_HAL_BASTREAM *
|
const MWL_HAL_BASTREAM *
|
||||||
|
|||||||
Reference in New Issue
Block a user