From patchwork Mon Jul 20 15:06:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 6828581 Return-Path: X-Original-To: patchwork-dri-devel@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 EA23C9F1D4 for ; Mon, 20 Jul 2015 15:06:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39085205EF for ; Mon, 20 Jul 2015 15:06:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 58C26205BE for ; Mon, 20 Jul 2015 15:06:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E5AE26E482; Mon, 20 Jul 2015 08:06:13 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5CE5E6E419; Mon, 20 Jul 2015 08:06:12 -0700 (PDT) Received: by pabkd10 with SMTP id kd10so30613293pab.2; Mon, 20 Jul 2015 08:06:12 -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; bh=mUJDuwsnC4+vSog019DIQdVA8zrPDw+0MXcF3MnoojY=; b=KTRYa5trO+jURIFcqaXrOVlE1qXptseB0OoJ8xk602/Iwd5MpRFPVi61Hh6oZwsooX EoVA8ke58Do6F2s/7mwgyBxkotV2owxo+1p7hC/Wqrog8LYup+i80+eMVTijG2D+Ns8b Zp4QEuwTJHR1uHwdG2bNxQXMokttSbrHHMKXLLilOsge5MPpKA8qQxLlpm/39QtX6ddY NG796Scw54a+HIdd0S+fYL7A+i8eFrwywPjohACyYF5pfWiUxkMHCBn1/kN/onpufdIt +fEOyoj3R4cTmEdV/OWeogjhZicSEt0mbHTgj7115L+JSBeIvX4vl7WaZ6qzQ50fWWUq Iikg== X-Received: by 10.66.249.233 with SMTP id yx9mr59808856pac.133.1437404772011; Mon, 20 Jul 2015 08:06:12 -0700 (PDT) Received: from localhost.localdomain ([49.206.252.123]) by smtp.gmail.com with ESMTPSA id wp5sm22408620pab.22.2015.07.20.08.06.08 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Jul 2015 08:06:11 -0700 (PDT) From: Sudip Mukherjee To: Daniel Vetter , Jani Nikula , David Airlie Subject: [PATCH v2] drm/i915: remove unnecessary null test Date: Mon, 20 Jul 2015 20:36:01 +0530 Message-Id: <1437404761-2617-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 Cc: Sudip Mukherjee , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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 While creating the debugfs file we are setting the inode->i_private to dev. That same dev is passed to these functions as private of struct seq_file via single_open(). So at this point it can never be NULL. Signed-off-by: Sudip Mukherjee --- v1 was drm/i915: fix possible null pointer dereference drivers/gpu/drm/i915/i915_debugfs.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index bc817da..63cb886 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -4103,9 +4103,6 @@ static int i915_displayport_test_active_show(struct seq_file *m, void *data) struct list_head *connector_list = &dev->mode_config.connector_list; struct intel_dp *intel_dp; - if (!dev) - return -ENODEV; - list_for_each_entry(connector, connector_list, head) { if (connector->connector_type != @@ -4150,9 +4147,6 @@ static int i915_displayport_test_data_show(struct seq_file *m, void *data) struct list_head *connector_list = &dev->mode_config.connector_list; struct intel_dp *intel_dp; - if (!dev) - return -ENODEV; - list_for_each_entry(connector, connector_list, head) { if (connector->connector_type != @@ -4192,9 +4186,6 @@ static int i915_displayport_test_type_show(struct seq_file *m, void *data) struct list_head *connector_list = &dev->mode_config.connector_list; struct intel_dp *intel_dp; - if (!dev) - return -ENODEV; - list_for_each_entry(connector, connector_list, head) { if (connector->connector_type !=