diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-05-01 09:31:12 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-05-14 01:54:09 -0400 |
commit | 3f98387efa9333c5765d36e144c47c107d6ba64a (patch) | |
tree | b5c8f515aecf306b0e0b6087458d221d9411f6cb /drivers/media/video/ivtv/ivtv-streams.c | |
parent | 6a4a79355bfa9ae6977556595a68f2e3a0e143f7 (diff) |
V4L/DVB (7854): cx18/ivtv: improve and fix out-of-memory handling
- don't show kernel backtrace when the allocation of the buffers fails: the
normal ivtv/cx18 messages are clear enough and the backtrace scares users.
- fix cleanup after the buffer allocation fails (caused kernel panic).
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-streams.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-streams.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index 4ab8d36831ba..c47c2b945147 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -244,7 +244,7 @@ int ivtv_streams_setup(struct ivtv *itv) | |||
244 | return 0; | 244 | return 0; |
245 | 245 | ||
246 | /* One or more streams could not be initialized. Clean 'em all up. */ | 246 | /* One or more streams could not be initialized. Clean 'em all up. */ |
247 | ivtv_streams_cleanup(itv); | 247 | ivtv_streams_cleanup(itv, 0); |
248 | return -ENOMEM; | 248 | return -ENOMEM; |
249 | } | 249 | } |
250 | 250 | ||
@@ -304,12 +304,12 @@ int ivtv_streams_register(struct ivtv *itv) | |||
304 | return 0; | 304 | return 0; |
305 | 305 | ||
306 | /* One or more streams could not be initialized. Clean 'em all up. */ | 306 | /* One or more streams could not be initialized. Clean 'em all up. */ |
307 | ivtv_streams_cleanup(itv); | 307 | ivtv_streams_cleanup(itv, 1); |
308 | return -ENOMEM; | 308 | return -ENOMEM; |
309 | } | 309 | } |
310 | 310 | ||
311 | /* Unregister v4l2 devices */ | 311 | /* Unregister v4l2 devices */ |
312 | void ivtv_streams_cleanup(struct ivtv *itv) | 312 | void ivtv_streams_cleanup(struct ivtv *itv, int unregister) |
313 | { | 313 | { |
314 | int type; | 314 | int type; |
315 | 315 | ||
@@ -322,8 +322,11 @@ void ivtv_streams_cleanup(struct ivtv *itv) | |||
322 | continue; | 322 | continue; |
323 | 323 | ||
324 | ivtv_stream_free(&itv->streams[type]); | 324 | ivtv_stream_free(&itv->streams[type]); |
325 | /* Unregister device */ | 325 | /* Unregister or release device */ |
326 | video_unregister_device(vdev); | 326 | if (unregister) |
327 | video_unregister_device(vdev); | ||
328 | else | ||
329 | video_device_release(vdev); | ||
327 | } | 330 | } |
328 | } | 331 | } |
329 | 332 | ||