From patchwork Thu Jul 10 21:54:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oded Gabbay X-Patchwork-Id: 4528821 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EF7B59F37C for ; Thu, 10 Jul 2014 23:34:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 367D9201F4 for ; Thu, 10 Jul 2014 23:34:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5F20C201B4 for ; Thu, 10 Jul 2014 23:34:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 36C276E7CE; Thu, 10 Jul 2014 16:33:27 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 839C66E163 for ; Thu, 10 Jul 2014 14:57:23 -0700 (PDT) Received: by mail-wi0-f174.google.com with SMTP id d1so3054563wiv.7 for ; Thu, 10 Jul 2014 14:57:22 -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=F8UefYR/4oizucasIa6H0eObf4FXBPYTQEoNXfz73l0=; b=zOTt3v1AvFWe7gTvc7p3sPHUyj+ZpB10VOAX5SH6T7MnaWC/xsOveBENRwyUCdQt2b 6H8/xE30hPIwyRwQq4kE0IlhJ7lgT1tZUqWfgaLUeKuyg3SHEbygwiwJAbtSmx2mGl/9 qgXoCBLFTPzldeuDu8EbwyuFNpQ89VcvxB21n4riiNA+m5xM2Mz0/KbR61815Z2/i0dI hI4x4twVgjsJj8JkR2t8iTyIa7Swy5INWyXy5oOsKDv2oGVe5Mh9o+J10LSi43RRJnmR /o0Q7Ii+hwCvx1wnAkdOJeJQSMH7LBl2Aa1a6HoLyFGVrm5pUW0TDcOJg3iaUXCiVStf HrQg== X-Received: by 10.194.234.1 with SMTP id ua1mr972835wjc.42.1405029442727; Thu, 10 Jul 2014 14:57:22 -0700 (PDT) Received: from localhost.localdomain ([77.127.59.49]) by mx.google.com with ESMTPSA id pq9sm831097wjc.35.2014.07.10.14.57.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 14:57:22 -0700 (PDT) From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Subject: [PATCH 74/83] hsa/radeon: Adding some error messages Date: Fri, 11 Jul 2014 00:54:30 +0300 Message-Id: <1405029279-6894-46-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> References: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> X-Mailman-Approved-At: Thu, 10 Jul 2014 16:33:12 -0700 Cc: Andrew Lewycky , Ben Goz , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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=-4.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, 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 From: Ben Goz Signed-off-by: Ben Goz Signed-off-by: Oded Gabbay --- drivers/gpu/hsa/radeon/kfd_chardev.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/hsa/radeon/kfd_chardev.c b/drivers/gpu/hsa/radeon/kfd_chardev.c index 09c9a61..be89d26 100644 --- a/drivers/gpu/hsa/radeon/kfd_chardev.c +++ b/drivers/gpu/hsa/radeon/kfd_chardev.c @@ -137,11 +137,15 @@ kfd_ioctl_create_queue(struct file *filep, struct kfd_process *p, void __user *a if (copy_from_user(&args, arg, sizeof(args))) return -EFAULT; - if (!access_ok(VERIFY_WRITE, args.read_pointer_address, sizeof(qptr_t))) + if (!access_ok(VERIFY_WRITE, args.read_pointer_address, sizeof(qptr_t))) { + pr_err("kfd: can't access read pointer"); return -EFAULT; + } - if (!access_ok(VERIFY_WRITE, args.write_pointer_address, sizeof(qptr_t))) + if (!access_ok(VERIFY_WRITE, args.write_pointer_address, sizeof(qptr_t))) { + pr_err("kfd: can't access write pointer"); return -EFAULT; + } q_properties.is_interop = false; q_properties.queue_percent = args.queue_percentage;