Skip to content
Commit fc490717 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

[media] v4l: Do not allow re-registering sub-devices



Albeit not prohibited explicitly, re-registering sub-devices generated a
big, loud warning which quite likely soon was followed by a crash. What
followed was re-initialising a media entity, driver's registered() callback
being called and re-adding a list entry to a list.

Prevent this by returning an error if a sub-device is already registered.

[mchehab@s-opensource.com: reorder logic to check if !sd before dereferencing it]
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>

Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 6a21b728
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment