<div dir="ltr">Hi <span style="font-family:arial,sans-serif;font-size:13px">Ilia Mirkin,</span><div><font face="arial, sans-serif">Thanks for your info. I did investigated why our test didn't detect it and found out that the struct ocm_block is only used on ocm_debugfs_show function when we want to know information about ocm and it's available when we enable debugfs. But our test only tried to use the OCM block functions and didn't care about the OCM information. So I think we should apply your patch to solve this issue instead of removing ocm part.</font></div>
<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif"><br></font></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Dec 7, 2013 at 7:43 AM, Ilia Mirkin <span dir="ltr"><<a href="mailto:imirkin@alum.mit.edu" target="_blank">imirkin@alum.mit.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Allocate enough memory for the ocm_block structure, not just a pointer<br>
to it.<br>
<br>
Signed-off-by: Ilia Mirkin <<a href="mailto:imirkin@alum.mit.edu">imirkin@alum.mit.edu</a>><br>
---<br>
<br>
I have neither the hardware to test nor the toolchain to even build-test<br>
this. However this seems like a fairly obvious fix (and I have to wonder how<br>
this ever worked at all). Found with spatch.<br>
<br>
Actually further investigation makes it seem like this function is never<br>
called, perhaps it should just be removed? If it is kept around though, would<br>
be nice to apply this patch so that tools don't trip over this wrong code.<br>
<br>
 arch/powerpc/sysdev/ppc4xx_ocm.c | 2 +-<br>
 1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/arch/powerpc/sysdev/ppc4xx_ocm.c b/arch/powerpc/sysdev/ppc4xx_ocm.c<br>
index b7c4345..85d9e37 100644<br>
--- a/arch/powerpc/sysdev/ppc4xx_ocm.c<br>
+++ b/arch/powerpc/sysdev/ppc4xx_ocm.c<br>
@@ -339,7 +339,7 @@ void *ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align,<br>
                if (IS_ERR_VALUE(offset))<br>
                        continue;<br>
<br>
-               ocm_blk = kzalloc(sizeof(struct ocm_block *), GFP_KERNEL);<br>
+               ocm_blk = kzalloc(sizeof(struct ocm_block), GFP_KERNEL);<br>
                if (!ocm_blk) {<br>
                        printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block");<br>
                        rh_free(ocm_reg->rh, offset);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.2<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><table style="BORDER-COLLAPSE:collapse" border="0" cellspacing="0" cellpadding="0" align="left">
<tbody>
<tr>
<td style="PADDING-BOTTOM:0.75pt;PADDING-LEFT:0.75pt;PADDING-RIGHT:0.75pt;PADDING-TOP:0.75pt">
<p style="MARGIN:6pt"><span style="COLOR:black;FONT-SIZE:7.5pt"><img src="https://sites.google.com/a/apm.com/logosig/_/rsrc/1278012978742/home/apm_sig_left_063010.jpg"></span></p></td>
<td style="PADDING-BOTTOM:0.75pt;PADDING-LEFT:0.75pt;PADDING-RIGHT:0.75pt;PADDING-TOP:0.75pt">
<p style="LINE-HEIGHT:12.2pt;MARGIN:0in 6pt 0pt"><b><span style="COLOR:#7f7f7f;FONT-SIZE:9pt">Vinh Nguyen Huu Tuong </span></b><b><span style="COLOR:#8cc63f;FONT-SIZE:9pt">|</span></b><b><span style="COLOR:#7f7f7f;FONT-SIZE:9pt"> Staff SW Engineer</span></b></p>

<p style="LINE-HEIGHT:12.2pt;MARGIN:0in 6pt 0pt"><span style="COLOR:#7f7f7f;FONT-SIZE:9pt">C: 090.335.7841 </span><span style="COLOR:#8cc63f;FONT-SIZE:9pt">|</span><span style="COLOR:#7f7f7f;FONT-SIZE:9pt"> O: 083.770.0640 ext: 3719</span><span style="COLOR:black;FONT-SIZE:12pt"></span></p>

<p style="LINE-HEIGHT:12.2pt;MARGIN:0in 6pt 0pt"><span style="COLOR:#7f7f7f;FONT-SIZE:9pt">F: 083.770.0641</span><span style="COLOR:#8cc63f;FONT-SIZE:9pt"> |</span><span style="COLOR:#7f7f7f;FONT-SIZE:9pt"> <a href="mailto:vhtnguyen@apm.com" target="_blank"><span>vhtnguyen@apm.com</span></a></span><span style="FONT-FAMILY:'Times New Roman','serif';COLOR:black;FONT-SIZE:12pt"></span></p>
</td></tr></tbody></table><br>
<div><br></div>
<div><br></div>
<div><br></div>
<div><br></div>
<div><br></div>
<div><br></div>
</div>