Input: tegra-kbc - allocate pdata before using it
authorViresh Kumar <viresh.kumar@st.com>
Tue, 27 Mar 2012 06:55:24 +0000 (23:55 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 27 Mar 2012 07:14:35 +0000 (00:14 -0700)
Following commit broke DT support for tegra-kbc by removing pdata
allocation completely:

   commit 023cea0ecfa2df034096c3f4afa796a0b2d1188a
   Author: Shridhar Rasal <srasal@nvidia.com>
   Date:   Fri Feb 3 00:27:30 2012 -0800

       Input: tegra-kbc - allow skipping setting up some of GPIO pins

This patch restores it.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/keyboard/tegra-kbc.c

index 21c42f852343e4fbfe2905d9dc5b75b96b9670db..fe4ac95ca6c8d340b23ac20909c8407c14637c98 100644 (file)
@@ -630,6 +630,7 @@ tegra_kbc_dt_parse_pdata(struct platform_device *pdev)
        if (!np)
                return NULL;
 
+       pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
        if (!pdata)
                return NULL;