Furthermore, it is important to form the tunnel insulating layer 209 having substantially no defects for ensuring the reliability of such an MRAM. When there exist defects such as pin holes in the tunnel insulating layer 209, the bit line 201 and the word line 202 short or the performance deteriorates locally, which causes the malfunction of the MRAM. However, the above-mentioned MRAM has a struct