lkml.org 
[lkml]   [2012]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 2/3] x86, RAS: Add a decoded msg buffer
Date
+	if (left <= 50) {
+ /* enlarge arbitrarily by 50 chars */
+ err_str_sz += 50;
+ left += 50;
+
+ err_str = krealloc(err_str, err_str_sz, GFP_KERNEL);
+ if (!err_str) {
+ pr_err("Error enlarging decode buffer.\n");
+ return;
+ }
+ }

This looks worrying to me. Some bad stuff has happened, we are perhaps
in machine check context, and you want to start allocating memory!

Is there some upper bound for how long this string can get? Why not
just allocate a generous amount at boot time?

-Tony


\
 
 \ /
  Last update: 2012-02-28 23:47    [W:0.122 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site