Skip to content

Commit

Permalink
OMAP: DSS2: Replace strncmp() with sysfs_streq() in overlay_manager_s…
Browse files Browse the repository at this point in the history
…tore()

The function overlay_manager_store currently fails if the sysfs input is a
prefix string of an existing overlay manager name. This occurs because strncmp
compares the two strings only till the length of the input sysfs string. So a
sysfs input "lcd" will match manager name "lcd2" which is incorrect behavior.

The use of sysfs_streq here will prevent this false positive match to occur.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
  • Loading branch information
Archit Taneja authored and Tomi Valkeinen committed Aug 5, 2010
1 parent e9c31af commit f3c77d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/video/omap2/dss/overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f3c77d6

Please sign in to comment.