Re: [PATCH] Thermal: Fix synchronization issues in thermal_sys.c

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

 



On Thu, Sep 27, 2012 at 8:21 AM, R, Durgadoss <durgadoss.r@xxxxxxxxx> wrote:
> Hi Rui,
>
>> -----Original Message-----
>> From: linux-acpi-owner@xxxxxxxxxxxxxxx [mailto:linux-acpi-
>> owner@xxxxxxxxxxxxxxx] On Behalf Of Zhang Rui
>> Sent: Thursday, September 27, 2012 11:45 AM
>> To: R, Durgadoss
>> Cc: lenb@xxxxxxxxxx; linux-acpi@xxxxxxxxxxxxxxx;
>> dan.carpenter@xxxxxxxxxx; hughd@xxxxxxxxxx; linux-
>> next@xxxxxxxxxxxxxxx
>> Subject: Re: [PATCH] Thermal: Fix synchronization issues in thermal_sys.c
>>
>> On 四, 2012-09-27 at 11:38 +0530, Durgadoss R wrote:
>> > This patch fixes the following mutex and NULL pointer
>> > problems in thermal_sys.c:
>> >  * mutex_unlock fix in update_temperature function
>> >  * mutex_unlock/NULL check fix in bind_cdev function
>> >  * NULL check fix in bind_tz function
>> >
>> > Signed-off-by: Durgadoss R <durgadoss.r@xxxxxxxxx>
>> > ---
>> >  drivers/thermal/thermal_sys.c |    9 +++++----
>> >  1 file changed, 5 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
>> > index 4f77d89..848553d 100644
>> > --- a/drivers/thermal/thermal_sys.c
>> > +++ b/drivers/thermal/thermal_sys.c
>> > @@ -252,8 +252,8 @@ static void bind_cdev(struct thermal_cooling_device
>> *cdev)
>> >             }
>> >
>> >             tzp = pos->tzp;
>> > -           if (!tzp->tbp)
>> > -                   return;
>> > +           if (!tzp || !tzp->tbp)
>> > +                   continue;
>> >
>> >             for (i = 0; i < tzp->num_tbps; i++) {
>> >                     if (tzp->tbp[i].cdev || !tzp->tbp[i].match)
>> > @@ -289,7 +289,7 @@ static void bind_tz(struct thermal_zone_device *tz)
>> >             goto exit;
>> >     }
>> >
>> > -   if (!tzp->tbp)
>> > +   if (!tzp || !tzp->tbp)
>> >             goto exit;
>> >
>> actually, this is not a problem.
>> I checked the code just now, tzp can not be NULL if the code runs here.
>
> I agree, I saw a similar kind of change needed in bind_tz, and hence
> added it here. Should we carry it as such ? or you want me to refresh by
> changing it ?
>
> Thanks for looking into this quickly.
>

Looks like you will sent a v2 of this patch.
Feel free to add a...

        Reported-by: Sedat Dilek <sedat.dilek@xxxxxxxxx>

,,, and don't forget Hugh :-).

- Sedat -

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


[Index of Archives]     [Linux Kernel]     [Linux USB Development]     [Yosemite News]     [Linux SCSI]

  Powered by Linux