diff options
| author | Takashi Iwai <tiwai@suse.de> | 2026-05-28 13:48:04 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-05-28 13:48:04 +0200 |
| commit | 2c142b63c8ee982cdfdba49a616027c266294838 (patch) | |
| tree | bd716f665d677cd3acba6e8b3de67c5e127116fa /net/core/devmem.c | |
| parent | 14912d497188283f5a0aa5daaa161e52f79c7f34 (diff) | |
| parent | f63ad68e18d774a5d15cd7e405ead63f6b322679 (diff) | |
Merge tag 'asoc-fix-v7.1-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v7.1
This round of fixes is mostly Sirini's Qualcomm cleanups that have been
in review for a while, we also have a couple of small fixes from Cássio.
Diffstat (limited to 'net/core/devmem.c')
| -rw-r--r-- | net/core/devmem.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/core/devmem.c b/net/core/devmem.c index 468344739db2..4f71de44c0fb 100644 --- a/net/core/devmem.c +++ b/net/core/devmem.c @@ -241,6 +241,11 @@ net_devmem_bind_dmabuf(struct net_device *dev, } if (direction == DMA_TO_DEVICE) { + if (!IS_ALIGNED(dmabuf->size, PAGE_SIZE)) { + err = -EINVAL; + NL_SET_ERR_MSG(extack, "TX dma-buf size must be a multiple of PAGE_SIZE"); + goto err_unmap; + } binding->tx_vec = kvmalloc_objs(struct net_iov *, dmabuf->size / PAGE_SIZE); if (!binding->tx_vec) { @@ -267,6 +272,12 @@ net_devmem_bind_dmabuf(struct net_device *dev, size_t len = sg_dma_len(sg); struct net_iov *niov; + if (!IS_ALIGNED(len, PAGE_SIZE)) { + err = -EINVAL; + NL_SET_ERR_MSG(extack, "dma-buf SG length must be PAGE_SIZE aligned"); + goto err_free_chunks; + } + owner = kzalloc_node(sizeof(*owner), GFP_KERNEL, dev_to_node(&dev->dev)); if (!owner) { |
