X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fsmbfs%2Frequest.c;h=c288fbe7953d982e1980fc8dd6db9b7815044030;hb=02a93208edec0d655c9f18613d830dc6afeda7d4;hp=42261dbdf60f172270dff8c70c1942c50a2ce0b3;hpb=54c66f6d781e03dc0b23956234963c4911e6d1c0;p=linux-2.6-omap-h63xx.git diff --git a/fs/smbfs/request.c b/fs/smbfs/request.c index 42261dbdf60..c288fbe7953 100644 --- a/fs/smbfs/request.c +++ b/fs/smbfs/request.c @@ -6,6 +6,7 @@ * Please add a note about your changes to smbfs in the ChangeLog file. */ +#include #include #include #include @@ -22,8 +23,6 @@ /* #define SMB_SLAB_DEBUG (SLAB_RED_ZONE | SLAB_POISON) */ #define SMB_SLAB_DEBUG 0 -#define ROUND_UP(x) (((x)+3) & ~3) - /* cache for request structures */ static struct kmem_cache *req_cachep; @@ -181,6 +180,7 @@ static int smb_setup_request(struct smb_request *req) req->rq_errno = 0; req->rq_fragment = 0; kfree(req->rq_trans2buffer); + req->rq_trans2buffer = NULL; return 0; } @@ -199,8 +199,8 @@ static int smb_setup_trans2request(struct smb_request *req) const int smb_parameters = 15; const int header = SMB_HEADER_LEN + 2 * smb_parameters + 2; - const int oparam = ROUND_UP(header + 3); - const int odata = ROUND_UP(oparam + req->rq_lparm); + const int oparam = ALIGN(header + 3, sizeof(u32)); + const int odata = ALIGN(oparam + req->rq_lparm, sizeof(u32)); const int bcc = (req->rq_data ? odata + req->rq_ldata : oparam + req->rq_lparm) - header;