Re: [PATCH RESEND] genirq: Machine-parsable version of /proc/interrupts

From: Craig Gallek
Date: Tue Sep 06 2016 - 16:55:44 EST


On Fri, Sep 2, 2016 at 10:59 AM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
> On Tue, 26 Jul 2016, Craig Gallek wrote:
>> +static void irq_kobj_release(struct kobject *kobj)
>> +{
>> + struct irq_desc *desc = container_of(kobj, struct irq_desc, kobj);
>> +
>> + /*
>> + * This irq_desc is statically allocated. Simply zero its kobject
>> + * rather than kfree it.
>> + */
>> + memset(&desc->kobj, 0, sizeof(desc->kobj));
>
> This will nicely explode when the irq descriptor is handed out again before
> this function is called.
>
> There is no point to make this work for !SPARSE_IRQ. Just ignore it.
Thank you for the review. Just one clarification before I send v2:
Are you suggesting getting rid of this feature entirely for the
non-sparse version or just this kobject cleanup code?