From patchwork Fri May 14 13:25:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 99610 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4EDQSjv017152 for ; Fri, 14 May 2010 13:26:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758113Ab0ENN01 (ORCPT ); Fri, 14 May 2010 09:26:27 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:58193 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757006Ab0ENN00 (ORCPT ); Fri, 14 May 2010 09:26:26 -0400 Received: by wyb36 with SMTP id 36so20668wyb.19 for ; Fri, 14 May 2010 06:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=Ffc/A4NFEw8u36B4zP7PAnxTLQw+65gU37Uaw8arMbU=; b=t3f/dQkiJqU2+BX2oyXrlEc63nD2o9lniuaiB4AenSTLT2FvWEalWOSd15sXR/4eal 1vCThLQ+6tNqVPHWW+vKSkR0SSDq2L05rwmKRp2PvG7Qmvkl6VTbeqCta8x9d1/NaimZ PAEvwz/IHHd3g6cj4J/Fsg3Q8QcJ5KfSgpyGg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=tKD5Ofz2/mqAljr60vopd0v4CJHb51J0CEZ8VFtJhVoV0lxrvULIaQx/s6A74Uj/t/ CWxBW9DWS16v5ckvLXqJpAa5eoZA4lIB8Qrjn7OpIRNDmy+SLq59t3J75zdUSbjKHPvI 0aC5r6Cpc7X2KdfdHiK4baOMo8FC4YA1Te9lg= Received: by 10.227.137.20 with SMTP id u20mr1274030wbt.134.1273843579104; Fri, 14 May 2010 06:26:19 -0700 (PDT) Received: from bicker ([205.177.176.130]) by mx.google.com with ESMTPS id y22sm16631158wby.5.2010.05.14.06.25.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 14 May 2010 06:26:18 -0700 (PDT) Date: Fri, 14 May 2010 15:25:39 +0200 From: Dan Carpenter To: "Luis R. Rodriguez" Cc: Jouni Malinen , Sujith Manoharan , Vasanthakumar Thiagarajan , Senthil Balasubramanian , "John W. Linville" , Felix Fietkau , Jeff Hansen , linux-wireless@vger.kernel.org, ath9k-devel@venema.h4ckr.net Subject: [patch -next 2/2] ath9k/debug: fixup the return codes Message-ID: <20100514132539.GH5695@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 14 May 2010 13:26:29 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index f344128..3123d16 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c @@ -56,7 +56,7 @@ static ssize_t write_file_debug(struct file *file, const char __user *user_buf, len = min(count, sizeof(buf) - 1); if (copy_from_user(buf, user_buf, len)) - return -EINVAL; + return -EFAULT; buf[len] = '\0'; if (strict_strtoul(buf, 0, &mask)) @@ -100,7 +100,7 @@ static ssize_t write_file_tx_chainmask(struct file *file, const char __user *use len = min(count, sizeof(buf) - 1); if (copy_from_user(buf, user_buf, len)) - return -EINVAL; + return -EFAULT; buf[len] = '\0'; if (strict_strtoul(buf, 0, &mask)) @@ -142,7 +142,7 @@ static ssize_t write_file_rx_chainmask(struct file *file, const char __user *use len = min(count, sizeof(buf) - 1); if (copy_from_user(buf, user_buf, len)) - return -EINVAL; + return -EFAULT; buf[len] = '\0'; if (strict_strtoul(buf, 0, &mask)) @@ -175,7 +175,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf, buf = kmalloc(DMA_BUF_LEN, GFP_KERNEL); if (!buf) - return 0; + return -ENOMEM; ath9k_ps_wakeup(sc); @@ -405,7 +405,7 @@ static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, max = 80 + sc->cur_rate_table->rate_cnt * 1024 + 1; buf = kmalloc(max, GFP_KERNEL); if (buf == NULL) - return 0; + return -ENOMEM; len += sprintf(buf, "%6s %6s %6s " "%10s %10s %10s %10s\n", @@ -640,7 +640,7 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf, buf = kzalloc(size, GFP_KERNEL); if (buf == NULL) - return 0; + return -ENOMEM; len += sprintf(buf, "%30s %10s%10s%10s\n\n", "BE", "BK", "VI", "VO"); @@ -713,7 +713,7 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf, buf = kzalloc(size, GFP_KERNEL); if (buf == NULL) - return 0; + return -ENOMEM; len += snprintf(buf + len, size - len, "%18s : %10u\n", "CRC ERR", @@ -832,7 +832,7 @@ static ssize_t write_file_regidx(struct file *file, const char __user *user_buf, len = min(count, sizeof(buf) - 1); if (copy_from_user(buf, user_buf, len)) - return -EINVAL; + return -EFAULT; buf[len] = '\0'; if (strict_strtoul(buf, 0, ®idx)) @@ -874,7 +874,7 @@ static ssize_t write_file_regval(struct file *file, const char __user *user_buf, len = min(count, sizeof(buf) - 1); if (copy_from_user(buf, user_buf, len)) - return -EINVAL; + return -EFAULT; buf[len] = '\0'; if (strict_strtoul(buf, 0, ®val))