From patchwork Sun Aug 17 22:40:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4732111 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50DB8C0338 for ; Sun, 17 Aug 2014 22:39:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C1BB2013A for ; Sun, 17 Aug 2014 22:39:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A417920136 for ; Sun, 17 Aug 2014 22:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbaHQWix (ORCPT ); Sun, 17 Aug 2014 18:38:53 -0400 Received: from mail-la0-f42.google.com ([209.85.215.42]:45046 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbaHQWiw (ORCPT ); Sun, 17 Aug 2014 18:38:52 -0400 Received: by mail-la0-f42.google.com with SMTP id pv20so3924102lab.1 for ; Sun, 17 Aug 2014 15:38:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zzPrjhx8lFnx2VCXyEfw/hKoe5LgqEpeMDbGbuWZg4Y=; b=nJ8+6dPn2La8B9Gy+9n1p8A8NIxyoB4SwZR2n/rhe0elStQKaj+IxZYHDMK14mURgr fyLiTYcb11tLIMPuAwslzfI2oB4JaY3DPKXIaRKDJSuqEQs7fBKlod09nSCOTg9OkdVR AKIu7dnUNDu6Vsx4MB6ZDnnvl+Uh1+j0GuYBhyNznI9l/UXxPoT6USMEl/QGIqlMXam5 1Z157pzcBhvbGFsFvwM12lQSrEkAjUaLkWnDFmrtprOGgQKV5A6SboLCIJ0GoyfDCR3s 5wOBcQ4TcQgksRNAuQHe0o2VE74gFjGWpZZ/CuLIBtT4TUyCOEKfNxwNuGZQOF1Gb+69 s8+Q== X-Gm-Message-State: ALoCoQmpA7QOySK8UhLyoTSq1FxoCiAaUSLtzGiEITTcWyP3JzNSSJT0U90rS54KzpcgYq6FTkbu X-Received: by 10.152.22.199 with SMTP id g7mr25622128laf.6.1408315130297; Sun, 17 Aug 2014 15:38:50 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id e7sm9373999lae.9.2014.08.17.15.38.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Aug 2014 15:38:49 -0700 (PDT) From: Rickard Strandqvist To: Steve Wise , Roland Dreier Cc: Rickard Strandqvist , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] infiniband: hw: cxgb3: cxio_hal.c: Cleaning up missing null-terminate after strncpy call Date: Mon, 18 Aug 2014 00:40:24 +0200 Message-Id: <1408315225-16807-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Added a guaranteed null-terminate after call to strncpy. Signed-off-by: Rickard Strandqvist --- drivers/infiniband/hw/cxgb3/cxio_hal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c index de1c61b4..5fc04e4 100644 --- a/drivers/infiniband/hw/cxgb3/cxio_hal.c +++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c @@ -933,6 +933,7 @@ int cxio_rdev_open(struct cxio_rdev *rdev_p) netdev_p = rdev_p->t3cdev_p->lldev; strncpy(rdev_p->dev_name, rdev_p->t3cdev_p->name, T3_MAX_DEV_NAME_LEN); + rdev_p->dev_name[T3_MAX_DEV_NAME_LEN - 1] = '\0'; } else { PDBG("%s t3cdev_p or dev_name must be set\n", __func__); return -EINVAL;