Re: [PATCH 6/8] drm/i915/gt: Fix memory leaks in per-gt sysfs

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

 



On Wed, 13 Apr 2022 11:11:07 -0700, Ashutosh Dixit wrote:
>
> All kmalloc'd kobjects need a kobject_put() to free memory. For example in
> previous code, kobj_gt_release() never gets called.

Even if kobj_gt_release() were to get called, the code allocates 'struct
kobj_gt' and frees 'struct kobject'. Similar memory leaks are also present
in sysfs_engines.c from where this code pattern is borrowed.

Since these memory leaks occur only at module unload (or device removal)
they are not serious but it may still be worth it to fix them and also not
further propagate an erroneous code pattern. Thanks.



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux