From patchwork Tue Mar 31 00:07:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 6126691 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC20F9F2EC for ; Tue, 31 Mar 2015 00:07:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F33B22043C for ; Tue, 31 Mar 2015 00:07:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F96520219 for ; Tue, 31 Mar 2015 00:07:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753942AbbCaAHs (ORCPT ); Mon, 30 Mar 2015 20:07:48 -0400 Received: from mail-qg0-f50.google.com ([209.85.192.50]:33914 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753920AbbCaAHp (ORCPT ); Mon, 30 Mar 2015 20:07:45 -0400 Received: by qgep97 with SMTP id p97so1351840qge.1 for ; Mon, 30 Mar 2015 17:07:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=rbL9fHy7qIX6DOIj3QY0rFL9ofuXOouET48lVAmrc5M=; b=Rb/LhHUv6JMSSRNbFBesrMlkadGp9RxooVtiZXiVF31LXYGIPbYddhcSPkTQcwT+4I gAz4cRp4wLAwPk2UQrHVphzSeUjND5z4fjznVZ8QJwe1P9eUrVURza95e17So8JcpH7i ++ZiDVV3nUKF8QvIWZPr4XKlXH/4ImIelRii2DJWoKuhXEV19v36TRCx0tqlOoyPKNIU YQ147LrQlYhimA8R53DpbB1S6qJ58P6BAwsw08hZ8qn+LBFa9gL39oZSsSA0NFWt3E0g vfFHVPa6b6Z8qbBqX3XzATxC7MVQ2NM5Z1NWHSIQCNw/krcjSYksqfq70XfUWk7oN0Ew jo5A== X-Received: by 10.55.56.20 with SMTP id f20mr24208961qka.100.1427760464800; Mon, 30 Mar 2015 17:07:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.84.81 with HTTP; Mon, 30 Mar 2015 17:07:24 -0700 (PDT) From: Steve French Date: Mon, 30 Mar 2015 19:07:24 -0500 Message-ID: Subject: [PATCH] CIFS: session servername can't be null To: "linux-cifs@vger.kernel.org" Cc: Jeff Layton , Shirish Pargaonkar , Sachin Prabhu Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP (updated incorporating a suggestion of Jeff's) remove impossible check Pointed out by Coverity (CID 115422) Signed-off-by: Steve French Reviewed-by: Jeff Layton --- fs/cifs/cifsencrypt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) server = kmalloc(2 + (len * 2), GFP_KERNEL); diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 4ac7445..aa0dc25 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -1,6 +1,9 @@ /* * fs/cifs/cifsencrypt.c * + * Encryption and hashing operations relating to NTLM, NTLMv2. See MS-NLMP + * for more detailed information + * * Copyright (C) International Business Machines Corp., 2005,2013 * Author(s): Steve French (sfrench@us.ibm.com) * @@ -515,7 +518,8 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash, __func__); return rc; } - } else if (ses->serverName) { + } else { + /* We use ses->serverName if no domain name available */ len = strlen(ses->serverName);