From patchwork Wed Jan 16 13:00:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volokh Konstantin X-Patchwork-Id: 1987821 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id CBA5F3FC85 for ; Wed, 16 Jan 2013 13:08:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753992Ab3APNIJ (ORCPT ); Wed, 16 Jan 2013 08:08:09 -0500 Received: from mail-lb0-f178.google.com ([209.85.217.178]:34111 "EHLO mail-lb0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752879Ab3APNII (ORCPT ); Wed, 16 Jan 2013 08:08:08 -0500 Received: by mail-lb0-f178.google.com with SMTP id l5so1024974lbo.37 for ; Wed, 16 Jan 2013 05:08:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=SVBqC0Nmdg8Kz3FaS4fXmEtghyEt2jgKNRxYVcqEouw=; b=CivuYZJFosnbmhKzm3+EVtQKYIsahNC6icTaNVPYbcWXFpIkXJ76NIYR9yIDEPL6AY 2qweOSiPKGWmbX1V6ofrjbBsuLVUs3XpoUOsGTyOI885Px6FsdyKpKhPdjawlomNO2bT j8QQTiwPYNlM1DhdYO7qHXW7sA/OrW3LQZw9ReMBYYLhdyZa95Vbn5uMfkaslLyVMHbK ubNWVTT7GzBYWcLgs+8DOO1WoaYNl8hfgBm9G2PpTTIYZtJ3EtvWNTfcpeNQGiAx9Ffw bT9vbxsPWE/oyfMj7s8X4qDKqo4gu5rO/UVkJvu4OWVSAHvNsjKQ+JReZvZZGOJWC1W3 7ZWw== X-Received: by 10.152.123.49 with SMTP id lx17mr1035556lab.52.1358341686320; Wed, 16 Jan 2013 05:08:06 -0800 (PST) Received: from localhost.localdomain (host-24-157-66-217.spbmts.ru. [217.66.157.24]) by mx.google.com with ESMTPS id q4sm919179lbj.15.2013.01.16.05.08.01 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 16 Jan 2013 05:08:05 -0800 (PST) From: Volokh Konstantin To: linux-media@vger.kernel.org Cc: mchehab@redhat.com, gregkh@linuxfoundation.org, volokh84@gmail.com, dhowells@redhat.com, rdunlap@xenotime.net, hans.verkuil@cisco.com, justinmattock@gmail.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] staging: media: go7007: firmware protection Protection for unfirmware load Date: Wed, 16 Jan 2013 17:00:49 +0400 Message-Id: <1358341251-10087-2-git-send-email-volokh84@gmail.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1358341251-10087-1-git-send-email-volokh84@gmail.com> References: <1358341251-10087-1-git-send-email-volokh84@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Volokh Konstantin --- drivers/staging/media/go7007/go7007-usb.c | 2 +- drivers/staging/media/go7007/go7007-v4l2.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/go7007/go7007-usb.c b/drivers/staging/media/go7007/go7007-usb.c index 5443e25..a6cad15 100644 --- a/drivers/staging/media/go7007/go7007-usb.c +++ b/drivers/staging/media/go7007/go7007-usb.c @@ -1245,7 +1245,6 @@ static void go7007_usb_disconnect(struct usb_interface *intf) struct urb *vurb, *aurb; int i; - go->status = STATUS_SHUTDOWN; usb_kill_urb(usb->intr_urb); /* Free USB-related structs */ @@ -1269,6 +1268,7 @@ static void go7007_usb_disconnect(struct usb_interface *intf) kfree(go->hpi_context); go7007_remove(go); + go->status = STATUS_SHUTDOWN; } static struct usb_driver go7007_usb_driver = { diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c index e6fa543..a69250f 100644 --- a/drivers/staging/media/go7007/go7007-v4l2.c +++ b/drivers/staging/media/go7007/go7007-v4l2.c @@ -1832,5 +1832,6 @@ void go7007_v4l2_remove(struct go7007 *go) mutex_unlock(&go->hw_lock); if (go->video_dev) video_unregister_device(go->video_dev); - v4l2_device_unregister(&go->v4l2_dev); + if (go->status != STATUS_SHUTDOWN) + v4l2_device_unregister(&go->v4l2_dev); }