From: Joerg Roedel <joerg.roedel@amd.com>
To: Ingo Molnar <mingo@redhat.com>
Cc: x86@kernel.org, iommu@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, Dan Carpenter <error27@gmail.com>,
Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 11/12] dma-debug: Cleanup for copy-loop in filter_write()
Date: Wed, 7 Apr 2010 14:46:48 +0200 [thread overview]
Message-ID: <1270644409-10123-12-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1270644409-10123-1-git-send-email-joerg.roedel@amd.com>
From: Dan Carpenter <error27@gmail.com>
Earlier in this function we set the last byte of "buf" to NULL so we
always hit the break statement and "i" is never equal to NAME_MAX_LEN.
This patch doesn't change how the driver works but it silences a Smatch
warning and it makes it clearer that we don't write past the end of the
array.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
lib/dma-debug.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index ba8b670..01e6427 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -570,7 +570,7 @@ static ssize_t filter_write(struct file *file, const char __user *userbuf,
* Now parse out the first token and use it as the name for the
* driver to filter for.
*/
- for (i = 0; i < NAME_MAX_LEN; ++i) {
+ for (i = 0; i < NAME_MAX_LEN - 1; ++i) {
current_driver_name[i] = buf[i];
if (isspace(buf[i]) || buf[i] == ' ' || buf[i] == 0)
break;
--
1.7.0.4
next prev parent reply other threads:[~2010-04-07 12:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-07 12:46 [GIT PULL][PATCH 0/12] IOMMU fixes for 2.6.34-rc3 Joerg Roedel
2010-04-07 12:46 ` [PATCH 01/12] x86/amd-iommu: Remove double NULL check in check_device Joerg Roedel
2010-04-07 12:46 ` [PATCH 02/12] x86/amd-iommu: Protect IOMMU-API map/unmap path Joerg Roedel
2010-04-07 12:46 ` [PATCH 03/12] x86/amd-iommu: Pt mode fix for domain_destroy Joerg Roedel
2010-04-07 12:46 ` [PATCH 04/12] x86/amd-iommu: Report errors in acpi parsing functions upstream Joerg Roedel
2010-04-07 12:46 ` [PATCH 05/12] x86/amd-iommu: Use helper function to destroy domain Joerg Roedel
2010-04-07 12:46 ` [PATCH 06/12] x86/amd-iommu: enable iommu before attaching devices Joerg Roedel
2010-04-07 12:46 ` [PATCH 07/12] x86/amd-iommu: warn when issuing command to uninitialized cmd buffer Joerg Roedel
2010-04-07 12:46 ` [PATCH 08/12] Revert "x86: disable IOMMUs on kernel crash" Joerg Roedel
2010-04-07 12:46 ` [PATCH 09/12] x86/amd-iommu: use for_each_pci_dev Joerg Roedel
2010-04-07 12:46 ` [PATCH 10/12] x86/amd-iommu: Remove obsolete parameter documentation Joerg Roedel
2010-04-07 12:46 ` Joerg Roedel [this message]
2010-04-07 12:46 ` [PATCH 12/12] x86/gart: Disable GART explicitly before initialization Joerg Roedel
2010-04-13 11:25 ` [GIT PULL][PATCH 0/12] IOMMU fixes for 2.6.34-rc3 Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1270644409-10123-12-git-send-email-joerg.roedel@amd.com \
--to=joerg.roedel@amd.com \
--cc=error27@gmail.com \
--cc=iommu@lists.linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®