From patchwork Tue Oct 19 16:47:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shirish Pargaonkar X-Patchwork-Id: 266111 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9JGrZAB018521 for ; Tue, 19 Oct 2010 16:53:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756190Ab0JSQxS (ORCPT ); Tue, 19 Oct 2010 12:53:18 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:62063 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756182Ab0JSQxQ (ORCPT ); Tue, 19 Oct 2010 12:53:16 -0400 Received: by pva18 with SMTP id 18so462184pva.19 for ; Tue, 19 Oct 2010 09:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=+TVwlr9rXYLIQD0K3363bjvzoH8RI4D2UX4TlnFnUzs=; b=IyXmd/9tS/47PLAv2QWxm8kvmkn0YsIwWlqvDJeduOyFZMsQhYYbUGLiohZ4a0/Sqp W9+TPcBujzkXTdGcQtndw6rO8lGUF7FgjPc/gMHjh+wgnwuq5l3azUyI62vjg6hJPQjk ezB3tGlT493fJOUlp6lTkls4ANdzmpAHV06wE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=rlqbCw7XGbr8OfDYKCSttp1iuThgfrQj7AGeUl9xEfSnrBa1NWMRJNelNsC7WKmSR+ 9dSV+Un2Opo2m3HN2FeDuaYreoXhMZXIwWbpW9Xvs0MNoTV5sXf9UGCEnvfFEuauRm8b khz590GzBIZAKzqWUE1tkf3jlc7NhsJl67jVU= Received: by 10.14.47.78 with SMTP id s54mr4059974eeb.21.1287507195632; Tue, 19 Oct 2010 09:53:15 -0700 (PDT) Received: from localhost ([32.97.110.58]) by mx.google.com with ESMTPS id e18sm5119796vcf.36.2010.10.19.09.53.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 19 Oct 2010 09:53:15 -0700 (PDT) From: shirishpargaonkar@gmail.com To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, Shirish Pargaonkar Subject: [PATCH] [CIFS] Clean up two declarations of blob_len Date: Tue, 19 Oct 2010 11:47:52 -0500 Message-Id: <1287506872-5700-1-git-send-email-shirishpargaonkar@gmail.com> X-Mailer: git-send-email 1.6.0.2 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 19 Oct 2010 16:53:35 +0000 (UTC) diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 2111bed..e35dc60 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -464,6 +464,7 @@ static void build_ntlmssp_negotiate_blob(unsigned char *pbuffer, maximum possible size is fixed and small, making this approach cleaner. This function returns the length of the data in the blob */ static int build_ntlmssp_auth_blob(unsigned char *pbuffer, + u16 *buflen, struct cifsSesInfo *ses, const struct nls_table *nls_cp) { @@ -558,7 +559,8 @@ static int build_ntlmssp_auth_blob(unsigned char *pbuffer, sec_blob->SessionKey.MaximumLength = 0; setup_ntlmv2_ret: - return tmp - pbuffer; + *buflen = tmp - pbuffer; + return rc; } @@ -591,7 +593,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int bytes_remaining; struct key *spnego_key = NULL; __le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */ - int blob_len; + u16 blob_len; char *ntlmsspblob = NULL; if (ses == NULL) @@ -848,8 +850,10 @@ ssetup_ntlmssp_authenticate: goto ssetup_exit; } - blob_len = build_ntlmssp_auth_blob(ntlmsspblob, - ses, nls_cp); + rc = build_ntlmssp_auth_blob(ntlmsspblob, + &blob_len, ses, nls_cp); + if (rc) + goto ssetup_exit; iov[1].iov_len = blob_len; iov[1].iov_base = ntlmsspblob; pSMB->req.SecurityBlobLength = @@ -927,7 +931,6 @@ ssetup_ntlmssp_authenticate: bcc_ptr = pByteArea(smb_buf); if (smb_buf->WordCount == 4) { - __u16 blob_len; blob_len = le16_to_cpu(pSMB->resp.SecurityBlobLength); if (blob_len > bytes_remaining) { cERROR(1, "bad security blob length %d", blob_len);