Battery Source for Arduino Uno & 1 12v dc motor?

The smoke came from one of the digital pins 1-7. Not sure which.

The batteries are connected like in the diagram. Does that connect to each other in any way?