summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-03-02 06:59:55 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-03-03 00:32:21 (GMT)
commit92a6253299d74833a36edb94d5a4bc541418b17a (patch)
tree2a1b9702e8e93c8e6877948b5b0fb6935e3dc7b0 /drivers
parentf2e332662bd38d1656ff31cf398de5a4ab15684c (diff)
downloadlinux-92a6253299d74833a36edb94d5a4bc541418b17a.tar.xz
Staging: ozwpan: prevent bogus dereference
app_id comes from the network and can't be trusted. If it's zero then it will lead to a kernel crash. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/ozwpan/ozpd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/ozwpan/ozpd.c b/drivers/staging/ozwpan/ozpd.c
index 8c460f0..e3381ad 100644
--- a/drivers/staging/ozwpan/ozpd.c
+++ b/drivers/staging/ozwpan/ozpd.c
@@ -806,7 +806,7 @@ void oz_apps_term(void)
void oz_handle_app_elt(struct oz_pd *pd, u8 app_id, struct oz_elt *elt)
{
struct oz_app_if *ai;
- if (app_id > OZ_APPID_MAX)
+ if (app_id == 0 || app_id > OZ_APPID_MAX)
return;
ai = &g_app_if[app_id-1];
ai->rx(pd, elt);