Messages in this thread | | | Date | Tue, 23 Sep 2008 15:33:14 -0500 | From | "Eric Van Hensbergen" <> | Subject | Re: [PATCH] 9p bug fix: return non-zero error value in p9_put_data |
| |
Hey - first of all, sorry for the long delay on responding to this, I've just gotten back to my patch queue.
On Tue, Sep 2, 2008 at 2:04 PM, Abhishek Kulkarni <kulkarni@lanl.gov> wrote: > Resubmitting my previous 9p bug fix patch that removes the bogus return > value in p9_put_data which made every p9_client_write fail. > > Signed-off-by: Abhishek Kulkarni <kulkarni@lanl.gov> > ---
Please include the original description when resubmitting patches -- this will allow me to suck it into my tree more effectively.
> > -static int > +static void > p9_put_data(struct cbuf *bufp, const char *data, int count, > unsigned char **pdata) > { > *pdata = buf_alloc(bufp, count); > memmove(*pdata, data, count); > - return count; > } >
What happens if buf_alloc returns NULL?
Isn't the right behavior something more along the lines of:
static int p9_put_data(struct cbuf *bufp, const char *data, int count, unsigned char **pdata) { *pdata = buf_alloc(bufp, count);' if(*pdata) memmove(*pdata, data, count); return 0; else return ENOMEM; }
-eric
| |