nr_channels is defined in "struct pch_dma". and struct pch_dma_chan is defined in "struct pch_dma". So, "sizeof(struct pch_dma_chan) * nr_channels" is unnecessary.
commit: 01631243d712d41681d61c0556341a3329860c47 kernel version: 3.0 Cc: [email protected] Signed-off-by: Tomoya MORINAGA <[email protected]> Signed-off-by: Vinod Koul <[email protected]> --- drivers/dma/pch_dma.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c index 6abe5ac..a6d0e3d 100644 --- a/drivers/dma/pch_dma.c +++ b/drivers/dma/pch_dma.c @@ -872,8 +872,7 @@ static int __devinit pch_dma_probe(struct pci_dev *pdev, int i; nr_channels = id->driver_data; - pd = kzalloc(sizeof(struct pch_dma)+ - sizeof(struct pch_dma_chan) * nr_channels, GFP_KERNEL); + pd = kzalloc(sizeof(*pd), GFP_KERNEL); if (!pd) return -ENOMEM; -- 1.7.7.6 -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
