Merge git://oss.sgi.com:8090/xfs/xfs-2.6
[linux-drm-fsl-dcu.git] / net / core / gen_estimator.c
index b07c029e8219e3fbe6493c28e560faf0de473612..17daf4c9f79384ad0005fbec5780cc8bd6f63321 100644 (file)
@@ -144,7 +144,7 @@ static void est_timer(unsigned long arg)
  * configuration TLV is created. Upon each interval, the latest statistics
  * will be read from &bstats and the estimated rate will be stored in
  * &rate_est with the statistics lock grabed during this period.
- * 
+ *
  * Returns 0 on success or a negative error code.
  */
 int gen_new_estimator(struct gnet_stats_basic *bstats,
@@ -159,11 +159,10 @@ int gen_new_estimator(struct gnet_stats_basic *bstats,
        if (parm->interval < -2 || parm->interval > 3)
                return -EINVAL;
 
-       est = kmalloc(sizeof(*est), GFP_KERNEL);
+       est = kzalloc(sizeof(*est), GFP_KERNEL);
        if (est == NULL)
                return -ENOBUFS;
 
-       memset(est, 0, sizeof(*est));
        est->interval = parm->interval + 2;
        est->bstats = bstats;
        est->rate_est = rate_est;
@@ -232,7 +231,7 @@ void gen_kill_estimator(struct gnet_stats_basic *bstats,
  *
  * Replaces the configuration of a rate estimator by calling
  * gen_kill_estimator() and gen_new_estimator().
- * 
+ *
  * Returns 0 on success or a negative error code.
  */
 int
@@ -243,7 +242,7 @@ gen_replace_estimator(struct gnet_stats_basic *bstats,
     gen_kill_estimator(bstats, rate_est);
     return gen_new_estimator(bstats, rate_est, stats_lock, opt);
 }
-    
+
 
 EXPORT_SYMBOL(gen_kill_estimator);
 EXPORT_SYMBOL(gen_new_estimator);