From patchwork Fri Jun 6 23:08:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4313801 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 0A1FABEEAA for ; Fri, 6 Jun 2014 23:08:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 17A6F201C7 for ; Fri, 6 Jun 2014 23:08:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3EA8B20145 for ; Fri, 6 Jun 2014 23:08:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752531AbaFFXIE (ORCPT ); Fri, 6 Jun 2014 19:08:04 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:33660 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752484AbaFFXID (ORCPT ); Fri, 6 Jun 2014 19:08:03 -0400 Received: by mail-wg0-f46.google.com with SMTP id b13so3219786wgh.17 for ; Fri, 06 Jun 2014 16:08:00 -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=Isd/53PDqClMYHMSE7j74W2mXvZlr+EixJ3/bKj6V94=; b=hwrU9zfxrmOYS/J9eFj3PjVoBljqWIQNiOGsTSgWi1QyQgNv4MTIGNRgcPT3AHEiak FBRMgnHhUhhdPe7J4mNienOvJNB99YM3bTWmOgCZnnykBe1RlX6+wRFnL+q4QSRzkCwI rLk4YFcAJt1Q+yNOiOGEx1BJmbtRuKyJXOyS2inVG3dTlXxG1/vDShfvrVhl3bWsLJ/l /0rZcXYhbfXY+AwX1BAjwHqcZGMnVpWqZNu4b+dqbIXLFblRABImZ9KFCvDKIesoXVFY GeR04IBGtrUorR7Q3+D8JIslqr4RicMenKCKJ15n0BhknUCv87zzm5Y5yseut7Oz27NV hRlA== X-Gm-Message-State: ALoCoQnH31YdH+d/DH3peLeL7p5N0aCQNhnLy36Hoa1UjNf7Li/dIMZega9+EH5Z04kHR0tXlVjT X-Received: by 10.14.210.9 with SMTP id t9mr1844602eeo.6.1402096080843; Fri, 06 Jun 2014 16:08:00 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id i2sm25957009eem.11.2014.06.06.16.07.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jun 2014 16:08:00 -0700 (PDT) From: Rickard Strandqvist To: Mike Marciniszyn , Roland Dreier Cc: Rickard Strandqvist , Sean Hefty , Hal Rosenstock , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] infiniband: hw: ipath: ipath_diag.c: Cleaning up code that is not handled properly. Date: Sat, 7 Jun 2014 01:08:56 +0200 Message-Id: <1402096136-9919-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.5 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 None of the code is adapted to handle a struct ipath_diag_pkt. This was partly found using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/infiniband/hw/ipath/ipath_diag.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/infiniband/hw/ipath/ipath_diag.c b/drivers/infiniband/hw/ipath/ipath_diag.c index e2f9a51..39ba797 100644 --- a/drivers/infiniband/hw/ipath/ipath_diag.c +++ b/drivers/infiniband/hw/ipath/ipath_diag.c @@ -327,7 +327,6 @@ static ssize_t ipath_diagpkt_write(struct file *fp, { u32 __iomem *piobuf; u32 plen, pbufn, maxlen_reserve; - struct ipath_diag_pkt odp; struct ipath_diag_xpkt dp; u32 *tmpbuf = NULL; struct ipath_devdata *dd; @@ -341,11 +340,6 @@ static ssize_t ipath_diagpkt_write(struct file *fp, ret = -EFAULT; goto bail; } - } else if (count == sizeof(odp)) { - if (copy_from_user(&odp, data, sizeof(odp))) { - ret = -EFAULT; - goto bail; - } } else { ret = -EINVAL; goto bail;