Skip to content
Snippets Groups Projects
Commit 5c78640a authored by kalpak's avatar kalpak
Browse files

b=13454

i=adilger, johann

Fix bug in jbd-stats patches spotted by coverity.
parent ff3d36f8
No related branches found
No related tags found
No related merge requests found
...@@ -269,7 +269,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c ...@@ -269,7 +269,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
+ return -EIO; + return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max; + size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL); + s->stats = kmalloc(size, GFP_KERNEL);
+ if (s == NULL) { + if (s->stats == NULL) {
+ kfree(s); + kfree(s);
+ return -EIO; + return -EIO;
+ } + }
...@@ -369,7 +369,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c ...@@ -369,7 +369,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
+ return -EIO; + return -EIO;
+ size = sizeof(struct transaction_stats_s); + size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL); + s->stats = kmalloc(size, GFP_KERNEL);
+ if (s == NULL) { + if (s->stats == NULL) {
+ kfree(s); + kfree(s);
+ return -EIO; + return -EIO;
+ } + }
......
...@@ -269,7 +269,7 @@ Index: linux-2.6.16.46-0.14/fs/jbd/journal.c ...@@ -269,7 +269,7 @@ Index: linux-2.6.16.46-0.14/fs/jbd/journal.c
+ return -EIO; + return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max; + size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL); + s->stats = kmalloc(size, GFP_KERNEL);
+ if (s == NULL) { + if (s->stats == NULL) {
+ kfree(s); + kfree(s);
+ return -EIO; + return -EIO;
+ } + }
...@@ -369,7 +369,7 @@ Index: linux-2.6.16.46-0.14/fs/jbd/journal.c ...@@ -369,7 +369,7 @@ Index: linux-2.6.16.46-0.14/fs/jbd/journal.c
+ return -EIO; + return -EIO;
+ size = sizeof(struct transaction_stats_s); + size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL); + s->stats = kmalloc(size, GFP_KERNEL);
+ if (s == NULL) { + if (s->stats == NULL) {
+ kfree(s); + kfree(s);
+ return -EIO; + return -EIO;
+ } + }
......
...@@ -269,7 +269,7 @@ Index: linux-2.6.13.4/fs/jbd/journal.c ...@@ -269,7 +269,7 @@ Index: linux-2.6.13.4/fs/jbd/journal.c
+ return -EIO; + return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max; + size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL); + s->stats = kmalloc(size, GFP_KERNEL);
+ if (s == NULL) { + if (s->stats == NULL) {
+ kfree(s); + kfree(s);
+ return -EIO; + return -EIO;
+ } + }
...@@ -369,7 +369,7 @@ Index: linux-2.6.13.4/fs/jbd/journal.c ...@@ -369,7 +369,7 @@ Index: linux-2.6.13.4/fs/jbd/journal.c
+ return -EIO; + return -EIO;
+ size = sizeof(struct transaction_stats_s); + size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL); + s->stats = kmalloc(size, GFP_KERNEL);
+ if (s == NULL) { + if (s->stats == NULL) {
+ kfree(s); + kfree(s);
+ return -EIO; + return -EIO;
+ } + }
......
...@@ -459,7 +459,7 @@ Index: linux-2.6.5-7.201/fs/jbd/journal.c ...@@ -459,7 +459,7 @@ Index: linux-2.6.5-7.201/fs/jbd/journal.c
+ return -EIO; + return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max; + size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL); + s->stats = kmalloc(size, GFP_KERNEL);
+ if (s == NULL) { + if (s->stats == NULL) {
+ kfree(s); + kfree(s);
+ return -EIO; + return -EIO;
+ } + }
...@@ -578,7 +578,7 @@ Index: linux-2.6.5-7.201/fs/jbd/journal.c ...@@ -578,7 +578,7 @@ Index: linux-2.6.5-7.201/fs/jbd/journal.c
+ return -EIO; + return -EIO;
+ size = sizeof(struct transaction_stats_s); + size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL); + s->stats = kmalloc(size, GFP_KERNEL);
+ if (s == NULL) { + if (s->stats == NULL) {
+ kfree(s); + kfree(s);
+ return -EIO; + return -EIO;
+ } + }
......
...@@ -460,7 +460,7 @@ Index: linux-2.6.9/fs/jbd/journal.c ...@@ -460,7 +460,7 @@ Index: linux-2.6.9/fs/jbd/journal.c
+ return -EIO; + return -EIO;
+ size = sizeof(struct transaction_stats_s) * journal->j_history_max; + size = sizeof(struct transaction_stats_s) * journal->j_history_max;
+ s->stats = kmalloc(size, GFP_KERNEL); + s->stats = kmalloc(size, GFP_KERNEL);
+ if (s == NULL) { + if (s->stats == NULL) {
+ kfree(s); + kfree(s);
+ return -EIO; + return -EIO;
+ } + }
...@@ -560,7 +560,7 @@ Index: linux-2.6.9/fs/jbd/journal.c ...@@ -560,7 +560,7 @@ Index: linux-2.6.9/fs/jbd/journal.c
+ return -EIO; + return -EIO;
+ size = sizeof(struct transaction_stats_s); + size = sizeof(struct transaction_stats_s);
+ s->stats = kmalloc(size, GFP_KERNEL); + s->stats = kmalloc(size, GFP_KERNEL);
+ if (s == NULL) { + if (s->stats == NULL) {
+ kfree(s); + kfree(s);
+ return -EIO; + return -EIO;
+ } + }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment