What you're describing sounds like the pedal is putting out a pedal down MIDI message [CC64 value 127] but the corresponding pedal up message [CC64 value 0] is going missing somehow. I assume you're using the regular damper pedal [the right pedal], and you're pressing and releasing the same pedal, without accidentally pressing [or leaving your foot on] either of the other two pedals]. You didn't specify as to the sound, so I'm also going to assume that the sound you're playing is a GB Software Instrument [and that you're not hearing any of the Yamaha's internal sounds] and it's that GB sound [tone which continues] that's sustaining even after you let the pedal up. [If it's a keyboard sound that's hanging then that's a different matter..]
To check if that's the case -- to see if GB is not receiving|recording the sustain pedal up messages -- record a bit and then open the Editor panel [E], set it to display MIDI CC messages [the button at the upper left of the Editor panel], and select Sustain as the Controller [at the bottom left]. You should see sustain pedal messages, as in the screenshot. Note: the pedal that comes with that Yamaha keyboard may put out continuous values rather then just on/off [like the pedal I used when I took the screenshot]. Either way, whenever you release the pedal the MIDI data [ the orange line] should drop to the bottom -- a value of 0. Click on one of those lowest nodes [dots] to see if those "off" values are in fact 0s -- of they're any value above 0 that would be why the pedal would continue to sustain even after you take your foot off.
If that turns out to be the case, then here are a few things you could do to troubleshoot..
- Close|reopen GB, shutdown|restart the computer
- Try in a different GB Project
- Try with a different keyboard|pedal
- Try with a different DAW [if possible]
- Check the pedal connection [keyboard manual p.36] -- if it's loose or incorrectly connected that could cause messages to be lost
- Make sure Local Control is turned off on the keyboard [manual p.29]
- Make sure Control Change message transmission is on [manual p.30]
- Try a hard reset of the keyboard [manual p.32]