It’s OK to vent vertically up to the attic, as long as you are (as you plan to be) carrying on and venting to the outside. To determine whether your total length of vent and number of 90 degree turns is OK, you’ll need to consult your dryer’s owner’s manual for the data.