Re: Re: [PATCH 2/2] misc: add driver support for MAX8997 MUIC

From: MyungJoo Ham
Date: Mon Nov 28 2011 - 23:43:14 EST


Sender : Andrew Morton<akpm@xxxxxxxxxxxxxxxxxxxx>
Date : 2011-11-29 08:48 (GMT+09:00)
Title : Re: [PATCH 2/2] misc: add driver support for MAX8997 MUIC
>
> On Thu, 24 Nov 2011 18:12:18 +0900
> Donggeun Kim wrote:
> >
> > ...
> >
> > +static irqreturn_t max8997_muic_irq_handler(int irq, void *data)
> > +{
> > + struct max8997_muic_info *info = data;
> > +
> > + dev_dbg(info->dev, "irq:%d ", irq);
> > + info->irq = irq;
> > +
> > + schedule_work(&info->irq_work);
> > +
> > + return IRQ_HANDLED;
> > +}
>
> The code does schedule_work() but I see no flush_work(). Is it
> possible for the work to still be pending after device shutdown, or
> even after rmmod?
>

Yes, it is possible that the work is still pending or running and use data that are freed by max8997_muic_remove().

To be safe with the last-minute interrupt handling, we may need to add flush_work or cancel_work_sync at max8997_muic_remove().

>

MyungJoo Ham (함명주)

Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: +82-10-6714-2858 / office: +82-31-279-8033
N떑꿩ìr¸›y鉉싕b²XФ푤vØ^–)頻{.nÇ+돴¥Š{±묎çzX㎍썳變}©옽Æ zÚ&j:+v돣¾«묎çzZ+€Ê+zf"·hš닱~넮녬iÿ鎬z¹®wⅱ¸?솳鈺Ú&¢)刪f뷌^j푹y§m끷@A«a뛴ÿ 0띠h®å’i