From patchwork Fri Mar 27 05:28:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 6103491 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 2F9989F318 for ; Fri, 27 Mar 2015 05:29:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6007A203F3 for ; Fri, 27 Mar 2015 05:29:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 82AED203E5 for ; Fri, 27 Mar 2015 05:29:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752748AbbC0F2t (ORCPT ); Fri, 27 Mar 2015 01:28:49 -0400 Received: from mail-ob0-f175.google.com ([209.85.214.175]:34377 "EHLO mail-ob0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752796AbbC0F2q (ORCPT ); Fri, 27 Mar 2015 01:28:46 -0400 Received: by obbgh1 with SMTP id gh1so1178261obb.1; Thu, 26 Mar 2015 22:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=o8jXNUcRKr3/iBeXPKsJBI3zSz4iAcD3k7H218SRk6I=; b=DT0K6y2eXXMSytGrd4UcCaQbpSF09+vdJXhazH0916lM1e3x2I6EgCUMQGVspCWhSI lRtt7YpJuFnjumxgYYvW9Ba2AvXq2SS6gP3EOPe6mxPDZJZf0MYOE2Ja3FYlePPCzatp i4eqBYalBXDRPKN+qtD1orKPsQJtGNY1pgHc1BtbnFHtOtYx4UlKZIi7wb5ubSTvMDEH fJ1WKoQZ+nq937ded7l3BlECktnRPzi9b8RTkhPJBNJ87K/Ptx5GHRZoMpSddb1tzBV0 4xPvx2QCScXl7Nol2m03AtE4J3tlSYbQkPH14aL/FZcPD6fbw7YJxtdIcm+bqHPjp9do nU+w== X-Received: by 10.202.91.138 with SMTP id p132mr14167193oib.47.1427434125502; Thu, 26 Mar 2015 22:28:45 -0700 (PDT) Received: from ubuntu.localdomain (cpe-68-203-16-26.austin.res.rr.com. [68.203.16.26]) by mx.google.com with ESMTPSA id mm3sm600258obb.1.2015.03.26.22.28.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2015 22:28:44 -0700 (PDT) From: Steve French To: linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org Cc: smfrench@gmail.com Subject: [PATCH 4/4] [SMB3] Fix coverity warning Date: Fri, 27 Mar 2015 00:28:02 -0500 Message-Id: <1427434082-4299-5-git-send-email-smfrench@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427434082-4299-1-git-send-email-smfrench@gmail.com> References: <1427434082-4299-1-git-send-email-smfrench@gmail.com> 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 Coverity reports a warning for referencing the beginning of the SMB2/SMB3 frame using the ProtocolId field as an array. Although it works the same either way, this patch should quiet the warning and might be a little clearer. Reported by Coverity (CID 741269) Signed-off-by: Steve French Acked-by: Shirish Pargaonkar Acked-by: Sachin Prabhu Acked-by: Jeff Layton --- fs/cifs/smb2misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index 689f035..22dfdf1 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -322,7 +322,7 @@ smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *hdr) /* return pointer to beginning of data area, ie offset from SMB start */ if ((*off != 0) && (*len != 0)) - return hdr->ProtocolId + *off; + return (char *)(&hdr->ProtocolId[0]) + *off; else return NULL; }