From 99a6acf9a7a80da49e85be964b15ffed9ab7643e Mon Sep 17 00:00:00 2001
From: Mike Isely <isely@pobox.com>
Date: Tue, 22 Apr 2008 14:45:39 -0300
Subject: V4L/DVB (7306): pvrusb2: Fix oops possible when claiming a NULL
 stream

Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
---
 drivers/media/video/pvrusb2/pvrusb2-context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'drivers/media')

diff --git a/drivers/media/video/pvrusb2/pvrusb2-context.c b/drivers/media/video/pvrusb2/pvrusb2-context.c
index 160437b21e6d..2a6726e403f0 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-context.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-context.c
@@ -173,7 +173,7 @@ int pvr2_channel_claim_stream(struct pvr2_channel *cp,
 	int code = 0;
 	pvr2_context_enter(cp->mc_head); do {
 		if (sp == cp->stream) break;
-		if (sp->user) {
+		if (sp && sp->user) {
 			code = -EBUSY;
 			break;
 		}
-- 
cgit v1.2.3