video: tegra: avoid null deref on nvdps read

When reading nvdps sysfs file, check mode to avoid a null dereference.

Bug 1032235
Bug 1283024

Change-Id: I19b3b5b3de6743cdcc9e3a846a4ba102de681ad3
Signed-off-by: Haley Teng <hteng@nvidia.com>
asoc: tegra: need to enable ahub clocks before accessing DAM registers

To avoid hard hang when you execute the below command lines

- cat /sys/kernel/debug/asoc/tegra30-dam.0
- cat /sys/kernel/debug/asoc/tegra30-dam.1
- cat /sys/kernel/debug/asoc/tegra30-dam.2

Bug 1283024

Change-Id: I1c18bd5c1bbf6059930b8bbb279e4a8596c85bdd
Signed-off-by: Haley Teng <hteng@nvidia.com>
tcp: fix FIONREAD/SIOCINQ

[ Upstream commit a3374c42aa5f7237e87ff3b0622018636b0c847e ]

tcp_ioctl() tries to take into account if tcp socket received a FIN
to report correct number bytes in receive queue.

But its flaky because if the application ate the last skb,
we return 1 instead of 0.

Correct way to detect that FIN was received is to test SOCK_DONE.

Reported-by: Elliot Hughes <enh@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ed Tam <etam@google.com>