staging: wilc1000: replace kmalloc_array/memset with kcalloc
authorChaehyun Lim <chaehyun.lim@gmail.com>
Tue, 22 Sep 2015 13:47:41 +0000 (22:47 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 00:32:36 +0000 (02:32 +0200)
This patch replaces kmalloc_array followed by memset with kcalloc.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/coreconfigurator.c

index 875b769d95a98a829a8cfa6162f6306cd0494aa9..8b56b92b5503ad7596cedba629ab985b8b16eb63 100644 (file)
@@ -644,13 +644,11 @@ s32 ParseSurveyResults(u8 ppu8RcvdSiteSurveyResults[][MAX_SURVEY_RESULT_FRAG_SIZ
                }
        }
 
-       pstrSurveyResults = kmalloc_array(u32SurveyResultsCount,
-                               sizeof(wid_site_survey_reslts_s), GFP_KERNEL);
+       pstrSurveyResults = kcalloc(u32SurveyResultsCount,
+                                   sizeof(wid_site_survey_reslts_s), GFP_KERNEL);
        if (!pstrSurveyResults)
                return -ENOMEM;
 
-       memset((void *)(pstrSurveyResults), 0, u32SurveyResultsCount * sizeof(wid_site_survey_reslts_s));
-
        u32SurveyResultsCount = 0;
 
        for (i = 0; i < u32RcvdSurveyResultsNum; i++) {