I would use 2 map functions, one for the servo and the other for the LED. Don't use the same variable for the output of the maps.
void loop() {
val = analogRead(potpin);
int LED = map(val, 0, 1024, 0, 255);
int SERVO = map(val, 0, 1024, 0, 179);
myservo.write(SERVO);
analogWrite(ledpin,LED);
delay(20);
}
Try this