struct channel_detector {
        struct list_head head;
        u16 freq;
-       struct pri_detector **detectors;
+       struct pri_detector *detectors[];
 };
 
 /* channel_detector_reset() - reset detector lines for a given channel */
        if (cd == NULL)
                return;
        list_del(&cd->head);
-       if (cd->detectors) {
-               for (i = 0; i < dpd->num_radar_types; i++) {
-                       struct pri_detector *de = cd->detectors[i];
-                       if (de != NULL)
-                               de->exit(de);
-               }
+
+       for (i = 0; i < dpd->num_radar_types; i++) {
+               struct pri_detector *de = cd->detectors[i];
+               if (de != NULL)
+                       de->exit(de);
        }
-       kfree(cd->detectors);
+
        kfree(cd);
 }
 
        u32 i;
        struct channel_detector *cd;
 
-       cd = kmalloc(sizeof(*cd), GFP_ATOMIC);
+       cd = kzalloc(struct_size(cd, detectors, dpd->num_radar_types), GFP_ATOMIC);
        if (cd == NULL)
                goto fail;
 
        INIT_LIST_HEAD(&cd->head);
        cd->freq = freq;
-       cd->detectors = kcalloc(dpd->num_radar_types,
-                                     sizeof(*cd->detectors), GFP_ATOMIC);
-       if (cd->detectors == NULL)
-               goto fail;
 
        for (i = 0; i < dpd->num_radar_types; i++) {
                const struct radar_detector_specs *rs = &dpd->radar_spec[i];