Re: [PATCH] scsi: ses fix for len and mem leaking when fail to add intf

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Yinghai Lu
Date: Saturday, February 9, 2008 - 3:28 pm

On Feb 9, 2008 7:00 AM, James Bottomley
<James.Bottomley@hansenpartnership.com> wrote:

thank. just learned that.

yhlu@yhlunb:~/xx/xx/notes> cat ctest.c
#include <stdio.h>
int main(int argc, char *argv[])
{
        unsigned char buf[20];
        int len;

        buf[2] = 0x02;
        buf[3] = 0x03;

        len = (buf[2] << 8) + buf[3];

        printf("len = %x\n", len);
        return 0;
}
yhlu@yhlunb:~/xx/xx/notes> gcc -o ctest ctest.c
yhlu@yhlunb:~/xx/xx/notes> ./ctest
len = 203
yhlu@yhlunb:~/xx/xx/notes>



the buf already become sdev->page1, sdev->pag10, sdev->page2.
so it will be freed via them


it became sdev->page1 already


OK


ok.


want to move out label out of if later.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] scsi: ses fix for len and mem leaking when fai ..., Yinghai Lu, (Sat Feb 9, 3:28 pm)
Re: [PATCH] scsi: ses fix mem leaking when fail to add intf, James Bottomley, (Sun Feb 10, 9:28 pm)
[SCSI] ses: fix memory leaks, Yinghai Lu, (Mon Feb 11, 12:25 am)
Re: [SCSI] ses: fix memory leaks, James Bottomley, (Mon Feb 11, 9:23 am)
Re: [SCSI] ses: fix memory leaks, James Bottomley, (Mon Feb 11, 10:02 am)
Re: [SCSI] ses: fix memory leaks, Yinghai Lu, (Mon Feb 11, 1:25 pm)
[PATCH] SCSI: fix data corruption caused by ses, Yinghai Lu, (Wed Feb 13, 12:10 am)
Re: [PATCH] SCSI: fix data corruption caused by ses, James Bottomley, (Wed Feb 13, 4:25 pm)
Re: [PATCH] SCSI: fix data corruption caused by ses, Yinghai Lu, (Wed Feb 13, 5:07 pm)
[PATCH] SCSI: fix data corruption caused by ses v2, Yinghai Lu, (Wed Feb 13, 5:25 pm)
Re: [PATCH] SCSI: fix data corruption caused by ses v2, James Bottomley, (Fri Feb 15, 8:53 am)
Re: [PATCH] SCSI: fix data corruption caused by ses v2, Yinghai Lu, (Fri Feb 15, 11:44 am)