i=adilger, johann
Fix bug in jbd-stats patches spotted by coverity.
+ return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL);
+ return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL);
++ if (s->stats == NULL) {
+ kfree(s);
+ return -EIO;
+ }
+ kfree(s);
+ return -EIO;
+ }
+ return -EIO;
+ size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL);
+ return -EIO;
+ size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL);
++ if (s->stats == NULL) {
+ kfree(s);
+ return -EIO;
+ }
+ kfree(s);
+ return -EIO;
+ }
+ return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL);
+ return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL);
++ if (s->stats == NULL) {
+ kfree(s);
+ return -EIO;
+ }
+ kfree(s);
+ return -EIO;
+ }
+ return -EIO;
+ size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL);
+ return -EIO;
+ size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL);
++ if (s->stats == NULL) {
+ kfree(s);
+ return -EIO;
+ }
+ kfree(s);
+ return -EIO;
+ }
+ return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL);
+ return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL);
++ if (s->stats == NULL) {
+ kfree(s);
+ return -EIO;
+ }
+ kfree(s);
+ return -EIO;
+ }
+ return -EIO;
+ size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL);
+ return -EIO;
+ size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL);
++ if (s->stats == NULL) {
+ kfree(s);
+ return -EIO;
+ }
+ kfree(s);
+ return -EIO;
+ }
+ return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL);
+ return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL);
++ if (s->stats == NULL) {
+ kfree(s);
+ return -EIO;
+ }
+ kfree(s);
+ return -EIO;
+ }
+ return -EIO;
+ size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL);
+ return -EIO;
+ size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL);
++ if (s->stats == NULL) {
+ kfree(s);
+ return -EIO;
+ }
+ kfree(s);
+ return -EIO;
+ }
+ return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL);
+ return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL);
++ if (s->stats == NULL) {
+ kfree(s);
+ return -EIO;
+ }
+ kfree(s);
+ return -EIO;
+ }
+ return -EIO;
+ size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL);
+ return -EIO;
+ size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL);
++ if (s->stats == NULL) {
+ kfree(s);
+ return -EIO;
+ }
+ kfree(s);
+ return -EIO;
+ }