diff options
author | Benjamin Sherman <benjamin@bensherman.io> | 2019-05-30 23:53:48 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-30 17:22:47 -0700 |
commit | 4c1d2fc7d56cf87a0d399be69e08d5aef73802eb (patch) | |
tree | 1951191001401f29d7b2c0e1b7681c8078668889 /drivers/staging/mt7621-dma | |
parent | staging: rtl8723bs: core: fix warning Comparison to NULL (diff) | |
download | linux-4c1d2fc7d56cf87a0d399be69e08d5aef73802eb.tar.gz linux-4c1d2fc7d56cf87a0d399be69e08d5aef73802eb.tar.bz2 linux-4c1d2fc7d56cf87a0d399be69e08d5aef73802eb.zip |
staging: mt7621-dma: sizeof via pointer dereference
Pass the size of a struct into kzalloc by pointer dereference. This
complies with the Linux kernel coding style and removes the possibility
for a bug if the pointer's type is changed.
Signed-off-by: Benjamin Sherman <benjamin@bensherman.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/mt7621-dma')
-rw-r--r-- | drivers/staging/mt7621-dma/mtk-hsdma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/mt7621-dma/mtk-hsdma.c b/drivers/staging/mt7621-dma/mtk-hsdma.c index a58725dd2611..60db06768c8a 100644 --- a/drivers/staging/mt7621-dma/mtk-hsdma.c +++ b/drivers/staging/mt7621-dma/mtk-hsdma.c @@ -468,7 +468,7 @@ static struct dma_async_tx_descriptor *mtk_hsdma_prep_dma_memcpy( if (len <= 0) return NULL; - desc = kzalloc(sizeof(struct mtk_hsdma_desc), GFP_ATOMIC); + desc = kzalloc(sizeof(*desc), GFP_ATOMIC); if (!desc) { dev_err(c->device->dev, "alloc memcpy decs error\n"); return NULL; |