qcacmn: Use atomic variant of qdf_mem_malloc for vdev stats
When kernel calls driver callback to get stats, dev_get_stats()-> ndo_get_stats64() .Host driver allocates memory using kmalloc (size, GFP_KERNEL) routine, but as ndo_get_stats is under RCU lock but not in interrupt context(in_irq = 0, in_interrupt = 0, irq_disable = 1), qdf_mem_malloc () uses ‘GFP_KERNEL’ to allocate memory, leading to backtrace for sleeping function call from invalid context. As per kernel doc (https://www.kernel.org/doc/Documentation/networking/statistics.rst), while in ndo_get_stats64 () API, driver should not calling a routing which can sleep. Use atomic variant of qdf_mem_malloc() to fix this. Change-Id: I775f53dd1e8165e962321215e65d46142fb3b3cc CRs-Fixed: 3128647
This commit is contained in:

committed by
Madan Koyyalamudi

parent
e1f64d3562
commit
cc4bde4708
@@ -8623,7 +8623,7 @@ static QDF_STATUS dp_vdev_getstats(struct cdp_vdev *vdev_handle,
|
||||
|
||||
soc = pdev->soc;
|
||||
|
||||
vdev_stats = qdf_mem_malloc(sizeof(struct cdp_vdev_stats));
|
||||
vdev_stats = qdf_mem_malloc_atomic(sizeof(struct cdp_vdev_stats));
|
||||
|
||||
if (!vdev_stats) {
|
||||
dp_cdp_err("%pK: DP alloc failure - unable to get alloc vdev stats",
|
||||
|
Reference in New Issue
Block a user