qcacmn: Check precondition at start of hif_snoc_enable_bus

ol_sc null check needs to happen before it is dereferenced.

Change-Id: I11820668fcbcc59c87ee7c675aec2451da030075
CRs-Fixed: 1072077
Bu işleme şunda yer alıyor:
Houston Hoffman
2016-09-27 23:42:48 -07:00
işlemeyi yapan: qcabuildsw
ebeveyn 125423fde1
işleme 834b927a37

Dosyayı Görüntüle

@@ -229,6 +229,12 @@ QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc,
int ret;
int hif_type;
int target_type;
if (!ol_sc) {
HIF_ERROR("%s: hif_ctx is NULL", __func__);
return QDF_STATUS_E_NOMEM;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(37));
#else
@@ -250,11 +256,6 @@ QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc,
return ret;
}
if (!ol_sc) {
HIF_ERROR("%s: hif_ctx is NULL", __func__);
return QDF_STATUS_E_NOMEM;
}
ret = hif_snoc_get_target_type(ol_sc, dev, bdev, bid,
&hif_type, &target_type);
if (ret < 0) {