Make sure that you turn off Find My iPhone on your device before you give it away or send it in for repair. Otherwise, your device is locked and anyone that you give the device to can't use it normally and Apple technicians can't perform service repairs. Just sign out of iCloud and then erase all content and settings.