Compare name length to avoid false positives in media_get_entity_by_name
authorSergio Aguirre <saaguirre@ti.com>
Wed, 25 Apr 2012 13:57:13 +0000 (08:57 -0500)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 29 Apr 2012 17:30:50 +0000 (19:30 +0200)
commit46bec667b675573cf1ce698c68112e3dbd31930e
tree997305e432fcc33b32bd07852cc39934f9e2a4a8
parentb5a1c3048a028965efe5af46801b9c14959703a2
Compare name length to avoid false positives in media_get_entity_by_name

If two subdevice have names that only differ by a suffix (such as "OMAP4
ISS ISP IPIPE" and "OMAP4 ISS ISP IPIPEIF") the media_get_entity_by_name
function might return a pointer to the entity with the longest name when
called with the shortest name. Fix this by verifying that the candidate
entity name length is equal to the requested name length.

Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
src/mediactl.c
src/tools.h