As LS.xD already mentioned, most manufaturers will void your warranty if you root it. But you can always unroot and return to the stock image in case you need to use your warranty. But most devices have a mechanism to set a flag to indicate that your device was already rooted in the past (such as Samsung Knox), and even "unrooting" it will not restore your warranty...