Re: [PATCH v3 4/5] dma: cppi41: only allocate descriptor memory once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Daniel Mack | 2013-09-22 16:50:03 [+0200]:

>cdd->cd and cdd->descs_phys are allocated DESCS_AREAS times from
>init_descs() and freed as often from purge_descs(). This leads to both
>memory leaks and double-frees.
>
>Fix this by pulling the calls to dma_{alloc,free}_coherent() out of the
>loops.
>
>While at it, remove the intermediate variable mem_decs (I guess it was
>only there to make the code comply to the 80-chars CodingSytle rule).
>
>Signed-off-by: Daniel Mack <zonque@xxxxxxxxx>

Please don't merge the memory descriptors. The idea was initially to
allocate multiple small descriptors instead one big. The descrriptor
turned out to be enough so it looks like the way it looks.
If you want to clean this up, please either remove the for loop and
allocate only one memory area or please prepare for multiple descripors
(I think two is the upper limit).

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux