summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorBryan Wu <pengw@nvidia.com>2014-03-25 13:23:12 -0700
committerTerje Bergstrom <tbergstrom@nvidia.com>2014-04-01 03:27:20 -0700
commit302f64aa5a587f949518b83a0b955a0494a4b7c5 (patch)
tree67bcfe26888d6ef4b713e5b8afeaab49ff768e13 /drivers/media
parent468d41e244e718dbc4dd5330c56cf83ccf1bcf4a (diff)
media: tegra_camera: add error check of nvhost_module_busy_ext
nvhost_module_busy_ext() needs error check, otherwise it might cause kernel oops from nvhost. Bug 1483752 Change-Id: Ib3b1d6c7ff53444f042725240073ea274e808ec2 Signed-off-by: Bryan Wu <pengw@nvidia.com> Reviewed-on: http://git-master/r/386453 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/soc_camera/tegra_camera/common.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/media/platform/soc_camera/tegra_camera/common.c b/drivers/media/platform/soc_camera/tegra_camera/common.c
index 893dd3c3c46c..8ed262da1cf6 100644
--- a/drivers/media/platform/soc_camera/tegra_camera/common.c
+++ b/drivers/media/platform/soc_camera/tegra_camera/common.c
@@ -119,12 +119,16 @@ static const struct soc_mbus_pixelfmt tegra_camera_formats[] = {
},
};
-static void tegra_camera_activate(struct tegra_camera_dev *cam)
+static int tegra_camera_activate(struct tegra_camera_dev *cam)
{
struct tegra_camera_ops *cam_ops = cam->ops;
int ret;
- nvhost_module_busy_ext(cam->ndev);
+ ret = nvhost_module_busy_ext(cam->ndev);
+ if (ret) {
+ dev_err(&cam->ndev->dev, "nvhost module is busy\n");
+ return ret;
+ }
/* Enable external power */
if (cam->reg) {
@@ -147,6 +151,8 @@ static void tegra_camera_activate(struct tegra_camera_dev *cam)
if (cam_ops->save_syncpts)
cam_ops->save_syncpts(cam);
+
+ return 0;
}
static void tegra_camera_deactivate(struct tegra_camera_dev *cam)
@@ -550,9 +556,12 @@ static int tegra_camera_add_device(struct soc_camera_device *icd)
{
struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
struct tegra_camera_dev *cam = ici->priv;
+ int ret;
if (!cam->enable_refcnt) {
- tegra_camera_activate(cam);
+ ret = tegra_camera_activate(cam);
+ if (ret)
+ return ret;
cam->num_frames = 0;
}
cam->enable_refcnt++;