LM317 vs series diode (1N4007) as voltage regulator?
The simple series diode is just fine IF you can guarantee that the input voltage will never exceed 5.2 Vdc.

The LM317 regulator has the advantage that it will protect the GSM module if the input voltage is excessive.  

For example, if someone connected the power supply to 12 Vdc instead of 5V, the LM317 regulator would simply get very hot, then shut down because of the internal thermal protection.  This would save your (expensive) GSM module from being damaged.

Either method is fine.