video: tegra: dc: hdcp: handle the case of DEVICE_COUNT = 0 properly
authorPeter Zu <pzu@nvidia.com>
Thu, 7 Apr 2011 04:42:33 +0000 (21:42 -0700)
committerErik Gilling <konkers@android.com>
Tue, 19 Apr 2011 20:05:57 +0000 (13:05 -0700)
When HDCP repeater has no device attached, DEVICE_COUNT reports back as 0.
HDCP driver should handle this case as a good case and continue downstream
authentication, other than fail it.

Change-Id: Ied2e46428c0247f14fbd96016cd4fdbf358f6587

drivers/video/tegra/dc/nvhdcp.c

index 7c8869a563f55578901eec1df8ad636c0a436e4a..5c2d9050a14b92128d28ec1b50a996b2d258b19b 100644 (file)
@@ -354,6 +354,9 @@ static int get_ksvfifo(struct tegra_nvhdcp *nvhdcp,
        if (!ksv_list || num_bksv_list > TEGRA_NVHDCP_MAX_DEVS)
                return -EINVAL;
 
+       if (num_bksv_list == 0)
+               return 0;
+
        buf = kmalloc(buf_len, GFP_KERNEL);
        if (IS_ERR_OR_NULL(buf))
                return -ENOMEM;