automatically re-starts
My macbook pro 13, sometimes when I turn it on and give the password and press enter/login it restarts and then when I give the password again it logins. Another thing is suppose i put a new desktop background, and when the above problem happens the desktop background (after restart) at the time of giving the password, changes to the default 'mountain wallpaper' (the blur background at the time of giving the password). But it remains same after login. Can anybody please help me out why it happens. It happens some times not all the times. Thanks in advance.
MacBook Pro (Retina, 13-inch,Early 2015), OS X Yosemite (10.10.4)