From: Russ Ross Date: Sun, 30 Jul 2006 10:04:15 +0000 (-0700) Subject: [PATCH] 9p: fix marshalling bug in tcreate with empty extension field X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4c90c68aca278f425afc0b48d86298b960fbc0ce;p=linux-beck.git [PATCH] 9p: fix marshalling bug in tcreate with empty extension field Signed-off-by: Russ Ross Signed-off-by: Eric Van Hensbergen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/9p/conv.c b/fs/9p/conv.c index 1e898144eb7c..56d88c1a09c5 100644 --- a/fs/9p/conv.c +++ b/fs/9p/conv.c @@ -673,8 +673,10 @@ struct v9fs_fcall *v9fs_create_tcreate(u32 fid, char *name, u32 perm, u8 mode, struct cbuf *bufp = &buffer; size = 4 + 2 + strlen(name) + 4 + 1; /* fid[4] name[s] perm[4] mode[1] */ - if (extended && extension!=NULL) - size += 2 + strlen(extension); /* extension[s] */ + if (extended) { + size += 2 + /* extension[s] */ + (extension == NULL ? 0 : strlen(extension)); + } fc = v9fs_create_common(bufp, size, TCREATE); if (IS_ERR(fc))