[Cbe-oss-dev] [PATCH] return only valid data in ibox_info and mbox_info

Jeremy Kerr jk at ozlabs.org
Tue Dec 18 11:57:21 EST 2007


Hi Arnd,

> I went through all the old patches this week and noticed you never
> picked this one up. Do you wish to queue it for 2.6.25?

Yep, would be good to fix this, however:

> @@ -1779,13 +1779,15 @@ static ssize_t __spufs_mbox_info_read(struct spu_context *ctx, {
>         u32 mbox_stat;
>         u32 data;
> +       u32 size = 0;
>  
>         mbox_stat = ctx->csa.prob.mb_stat_R;
>         if (mbox_stat & 0x0000ff) {
> +               size = sizeof data;
>                 data = ctx->csa.prob.pu_mb_R;
>         }
>  
> -       return simple_read_from_buffer(buf, len, pos, &data, sizeof data);
> +       return simple_read_from_buffer(buf, len, pos, &data, size);
>  }

how about just returning 0 if (!(mbox_stat & 0x0000ff)) ?

Cheers,


Jeremy



More information about the cbe-oss-dev mailing list