aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cpia.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cpia.c')
-rw-r--r--drivers/media/video/cpia.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index 7e8d5ef58b61..78c9699eafbb 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -1350,13 +1350,13 @@ out:
1350 1350
1351static void create_proc_cpia_cam(struct cam_data *cam) 1351static void create_proc_cpia_cam(struct cam_data *cam)
1352{ 1352{
1353 char name[7]; 1353 char name[5 + 1 + 10 + 1];
1354 struct proc_dir_entry *ent; 1354 struct proc_dir_entry *ent;
1355 1355
1356 if (!cpia_proc_root || !cam) 1356 if (!cpia_proc_root || !cam)
1357 return; 1357 return;
1358 1358
1359 sprintf(name, "video%d", cam->vdev.minor); 1359 snprintf(name, sizeof(name), "video%d", cam->vdev.minor);
1360 1360
1361 ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root); 1361 ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
1362 if (!ent) 1362 if (!ent)
@@ -1376,12 +1376,12 @@ static void create_proc_cpia_cam(struct cam_data *cam)
1376 1376
1377static void destroy_proc_cpia_cam(struct cam_data *cam) 1377static void destroy_proc_cpia_cam(struct cam_data *cam)
1378{ 1378{
1379 char name[7]; 1379 char name[5 + 1 + 10 + 1];
1380 1380
1381 if (!cam || !cam->proc_entry) 1381 if (!cam || !cam->proc_entry)
1382 return; 1382 return;
1383 1383
1384 sprintf(name, "video%d", cam->vdev.minor); 1384 snprintf(name, sizeof(name), "video%d", cam->vdev.minor);
1385 remove_proc_entry(name, cpia_proc_root); 1385 remove_proc_entry(name, cpia_proc_root);
1386 cam->proc_entry = NULL; 1386 cam->proc_entry = NULL;
1387} 1387}
@@ -3153,8 +3153,7 @@ static int reset_camera(struct cam_data *cam)
3153 3153
3154static void put_cam(struct cpia_camera_ops* ops) 3154static void put_cam(struct cpia_camera_ops* ops)
3155{ 3155{
3156 if (ops->owner) 3156 module_put(ops->owner);
3157 module_put(ops->owner);
3158} 3157}
3159 3158
3160/* ------------------------- V4L interface --------------------- */ 3159/* ------------------------- V4L interface --------------------- */