From patchwork Sat May 15 13:36:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 99820 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 o4FDb9XX013778 for ; Sat, 15 May 2010 13:37:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753786Ab0EONhI (ORCPT ); Sat, 15 May 2010 09:37:08 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:50451 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753031Ab0EONhG (ORCPT ); Sat, 15 May 2010 09:37:06 -0400 Received: by fxm6 with SMTP id 6so2348414fxm.19 for ; Sat, 15 May 2010 06:37:05 -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:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=yXOM4TrrOxr7ZSwtBIvXp0rxebn6kSNdPkc8QDUisE4=; b=MjNLikiqLmmxoELvRhqmaPk/vV+1iXHnYFIvFzyc4kTdXEFk1jqy4NYlyavoYiP64w xgykI+XEPApIBVXol6PrqxTVRwOzF/RbJM2fI/A9ozLxM8+8ETPUaGQG59UqB4MLRH+a 7JRkjJVtKQd72DVjfHqqidwEc7xKvTCOva8ko= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=TaBInLVeYsY0OE6F1LsjeQGYrK+dNZbZJzbg/khzg21RuP4hzcrjI7Vzj8X48lYROi C87p8EcRqwrU82+mHWC/x5BfH+6uGd33sJ+Q+JIrsK2SDFdi1lViiHycx/j2OFZ1wr5I MYGV+Q21ejFs3U4Qrdoj3Yuom2LgitrSKROVs= Received: by 10.223.101.4 with SMTP id a4mr3185367fao.71.1273930625007; Sat, 15 May 2010 06:37:05 -0700 (PDT) Received: from bicker ([217.113.76.242]) by mx.google.com with ESMTPS id 15sm15919217fad.22.2010.05.15.06.36.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 15 May 2010 06:37:04 -0700 (PDT) Date: Sat, 15 May 2010 15:36:16 +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 v2] ath9k/debug: fixup the return codes Message-ID: <20100515133616.GC5381@bicker> References: <20100514132539.GH5695@bicker> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100514132539.GH5695@bicker> 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]); Sat, 15 May 2010 13:37:09 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index fad1c85..3ff6a52 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); @@ -407,7 +407,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", @@ -644,7 +644,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"); @@ -718,7 +718,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", @@ -838,7 +838,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)) @@ -880,7 +880,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))