Taking stoichiometry in to consideration, take 1/2 of moles of HCl for moles of MgCl2. Use the equation n=m/M where
n = moles
m = mass
M = molar mass
[please do give the molar masses with the question. So if CONSIDERING molar mass of Mg = 24gmol^-1 and CL = 35.5gmol^-1]
M(MgCl2) = 95gmol^-1
m= n×M
m = 2.4 × 95 =228gmol^-1