From: Archit Taneja <archit@ti.com>
To: tomi.valkeinen@nokia.com
Cc: linux-omap@vger.kernel.org, Archit Taneja <archit@ti.com>
Subject: [PATCH resend] OMAP: DSS2: Replace strncmp() with sysfs_streq() in overlay_manager_store()
Date: Wed, 28 Jul 2010 11:51:58 +0530 [thread overview]
Message-ID: <1280298118-4295-1-git-send-email-archit@ti.com> (raw)
In-Reply-To: <'>
In the function overlay_manager_store, the length of the string
buf is used to comapre the 2 strings, there is a possibility of
false positive match if buf is a prefix string of another manager.
The use of sysfs_streq() fixes this.
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/overlay.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index 8233658..244dca8
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -65,7 +65,7 @@ static ssize_t overlay_manager_store(struct omap_overlay *ovl, const char *buf,
for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
mgr = omap_dss_get_overlay_manager(i);
- if (strncmp(buf, mgr->name, len) == 0)
+ if (sysfs_streq(buf, mgr->name))
break;
mgr = NULL;
--
1.5.4.7
next parent reply other threads:[~2010-07-28 6:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <'>
2010-07-28 6:21 ` Archit Taneja [this message]
2010-07-28 13:57 ` [PATCH resend] OMAP: DSS2: Replace strncmp() with sysfs_streq() in overlay_manager_store() Premi, Sanjeev
2010-07-28 14:36 ` Taneja, Archit
2010-07-28 17:03 ` Premi, Sanjeev
2010-07-29 3:45 ` Taneja, Archit
2010-07-29 5:30 ` Premi, Sanjeev
2010-07-29 5:56 ` Taneja, Archit
2010-07-29 10:57 ` Premi, Sanjeev
2010-07-29 11:09 ` Taneja, Archit
2010-07-29 11:12 ` Premi, Sanjeev
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=1280298118-4295-1-git-send-email-archit@ti.com \
--to=archit@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=tomi.valkeinen@nokia.com \
/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