diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-04-24 17:24:37 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-04-24 17:28:13 +0300 |
commit | 148a97d5a02a62f81b5d6176f871c94a65e1f3af (patch) | |
tree | ff277737564f9c4331054c98d70055d9b0f8473a /kernel/dma | |
parent | e43e2657fe77a37b13643e2469670ecdb0ba5e10 (diff) |
dma-mapping: remove an unnecessary NULL check
We already dereferenced "dev" when we called get_dma_ops() so this NULL
check is too late. We're not supposed to pass NULL "dev" pointers to
dma_alloc_attrs().
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel/dma')
-rw-r--r-- | kernel/dma/mapping.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 685a53f2a793..f7afdadb6770 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -244,7 +244,7 @@ void *dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle, const struct dma_map_ops *ops = get_dma_ops(dev); void *cpu_addr; - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); + WARN_ON_ONCE(!dev->coherent_dma_mask); if (dma_alloc_from_dev_coherent(dev, size, dma_handle, &cpu_addr)) return cpu_addr; |