diff options
author | Todor Tomov <ttomov@mm-sol.com> | 2011-01-04 11:49:56 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-01-04 23:28:15 +0100 |
commit | 5e883a1186481eb29d947d1453916c702b6bcd92 (patch) | |
tree | c07727c6cf4a62fce48df76bb50d2b032dc3578d /media.c | |
parent | 6971cf795cfefed91bba87c76eee0e8a28d22b7c (diff) |
media.c: fix NULL pointer dereference in media_enum_links()
Do not dereference source and sink in media_enum_links() if one
of them is NULL.
Signed-off-by: Todor Tomov <ttomov@mm-sol.com>
Diffstat (limited to 'media.c')
-rw-r--r-- | media.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -424,11 +424,11 @@ static int media_enum_links(struct media_device *media) id, i, link->source.entity, link->source.index, link->sink.entity, link->sink.index); ret = -EINVAL; + } else { + entity->links[i].source = &source->pads[link->source.index]; + entity->links[i].sink = &sink->pads[link->sink.index]; + entity->links[i].flags = links.links[i].flags; } - - entity->links[i].source = &source->pads[link->source.index]; - entity->links[i].sink = &sink->pads[link->sink.index]; - entity->links[i].flags = links.links[i].flags; } free(links.pads); |